Class

Auth

Auth()

The interface about authentication.

Constructor

# new Auth()

View Source Auth.ts, line 7

Classes

Auth

Methods

# async directSocialLogin(provider) → {Promise.<FaceLoginResponse>}

Directly sign-up(if new user) or login using social login. Need to initialize face with environment, blockchain and api key first.

Pass the desired login provider to parameter.

Parameters:
Name Type Description
provider LoginProviderType

'google.com' | 'facebook.com' | 'apple.com'

View Source Auth.ts, line 101

FaceLoginResponse. Unique user ID using on Face server and wallet address.

Promise.<FaceLoginResponse>

# async getCurrentUser() → {Promise.<FaceLoginResponse>}

Return user information.

View Source Auth.ts, line 131

Promise.<FaceLoginResponse>

# async isLoggedIn() → {Promise.<boolean>}

Check if user is already logged in.

View Source Auth.ts, line 139

Promise.<boolean>

# async login() → {Promise.<FaceLoginResponse>}

Sign-up(if new user) or login function. Need to initialize face with environment, blockchain and api key first.

You can choose three options, Google, Facebook, and Apple login.

View Source Auth.ts, line 90

FaceLoginResponse. Unique user ID using on Face server and wallet address.

Promise.<FaceLoginResponse>

# async loginWithIdToken(loginWithIdTokenRequest) → {Promise.<FaceLoginResponse>}

Login using the idToken published from social providers and Signature. Need to initialize face with environment, blockchain and api key first. You can make a Signature using Face Wallet SDK API Secret.

Pass the the idToken and Signature to parameters.

Parameters:
Name Type Description
loginWithIdTokenRequest LoginWithIdTokenRequest

View Source Auth.ts, line 113

FaceLoginResponse. Unique user ID using on Face server and wallet address.

Promise.<FaceLoginResponse>

# async logout() → {Promise.<void>}

Log out Face Wallet.

It will be resolved after successful logout.

View Source Auth.ts, line 123

Promise.<void>