From 213066918210ba8c056ec3656bf3dad40b1c0413 Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 12 Jun 2024 07:50:20 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'src/'=20with?= =?UTF-8?q?=20remote=20'src/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 22 +++++++++++----------- src/types.ts | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/index.ts b/src/index.ts index 235976b..077387e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -297,8 +297,8 @@ export class W3SSdk { configs?: Configs, onLoginComplete?: LoginCompleteCallback ) { - if (configs?.socialLoginConfigs?.apple && getApps().length === 0) { - this.firebaseApp = initializeApp(configs.socialLoginConfigs.apple) + if (configs?.loginConfigs?.apple && getApps().length === 0) { + this.firebaseApp = initializeApp(configs.loginConfigs.apple) } else if (getApps().length !== 0) { this.firebaseApp = getApps()[0] } @@ -392,7 +392,7 @@ export class W3SSdk { } private performFacebookLogin() { - if (!this?.configs?.socialLoginConfigs?.facebook) { + if (!this?.configs?.loginConfigs?.facebook) { void this.onLoginComplete?.( { code: 155140, @@ -404,7 +404,7 @@ export class W3SSdk { return } - const { appId, redirectUri } = this.configs.socialLoginConfigs.facebook + const { appId, redirectUri } = this.configs.loginConfigs.facebook const { url = '', state = '' } = this.generateOauthUrlWithParams( @@ -418,7 +418,7 @@ export class W3SSdk { } private performGoogleLogin() { - if (!this.configs?.socialLoginConfigs?.google) { + if (!this.configs?.loginConfigs?.google) { void this.onLoginComplete?.( { code: 155140, @@ -430,7 +430,7 @@ export class W3SSdk { return } - const { clientId, redirectUri } = this.configs.socialLoginConfigs.google + const { clientId, redirectUri } = this.configs.loginConfigs.google const { url = '', @@ -732,16 +732,16 @@ export class W3SSdk { deviceInfo: this.deviceInfo, ssoVerification: { token: this.socialLoginToken, - deviceToken: this.configs?.socialLoginConfigs?.deviceToken, + deviceToken: this.configs?.loginConfigs?.deviceToken, deviceEncryptionKey: - this.configs?.socialLoginConfigs?.deviceEncryptionKey, + this.configs?.loginConfigs?.deviceEncryptionKey, socialLoginProvider: this.socialLoginProvider, }, emailVerification: { - deviceToken: this.configs?.socialLoginConfigs?.deviceToken, + deviceToken: this.configs?.loginConfigs?.deviceToken, deviceEncryptionKey: - this.configs?.socialLoginConfigs?.deviceEncryptionKey, - otpToken: this.configs?.socialLoginConfigs?.otpToken, + this.configs?.loginConfigs?.deviceEncryptionKey, + otpToken: this.configs?.loginConfigs?.otpToken, }, }, }, diff --git a/src/types.ts b/src/types.ts index e22bbfa..868b6cb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -188,9 +188,9 @@ export enum SocialLoginProvider { } /** - * Social Login configurations, including Google, Facebook, and Apple. + * Login configurations, including Google, Facebook, and Apple. */ -export interface SocialLoginConfigs { +export interface LoginConfigs { google?: | { /** @@ -237,9 +237,9 @@ export interface Configs { */ authentication?: Authentication /** - * Social login configurations. + * Login configurations. */ - socialLoginConfigs?: SocialLoginConfigs + loginConfigs?: LoginConfigs } // Challenge Related