Skip to main content

Login

📋Prerequisites

Log into Passport

⚠️Warning
The gamer will not have a wallet unless ZkEvmRequestAccounts is called.

To log the gamer into Passport:

await passport.Login();

This will open the gamer's default browser and take them through the auth flow.

Stored Credentials

Once the gamer is connected to Passport, the SDK will store your credentials (access, ID, and refresh tokens).

You may use Login(useCachedSession: true) to re-login the gamer to Passport using the saved credentials. However, if this fails, it will not automatically prompt the user to re-login again.

bool hasCredsSaved = await passport.HasCredentialsSaved();
if (hasCredsSaved)
{
await passport.Login(useCachedSession: true);
// Successfully re-logged into Passport
}