diff --git a/src/core/auth.ts b/src/core/auth.ts index 6228d7a9..656c850b 100644 --- a/src/core/auth.ts +++ b/src/core/auth.ts @@ -3,6 +3,7 @@ import { SessionManager } from "@toruslabs/session-manager"; import { AUTH_ACTIONS, + AUTH_ACTIONS_TYPE, AuthOptions, AuthSessionConfig, AuthSessionData, @@ -336,7 +337,7 @@ export class Auth { window.open(loginUrl, "_blank"); } - async changeSocialFactor(params: SocialMfaModParams & Partial): Promise { + async manageSocialFactor(actionType: AUTH_ACTIONS_TYPE, params: SocialMfaModParams & Partial): Promise { if (!this.sessionId) throw LoginError.userNotLoggedIn(); // in case of redirect mode, redirect url will be dapp specified @@ -346,7 +347,7 @@ export class Auth { }; const dataObject: AuthSessionConfig = { - actionType: AUTH_ACTIONS.MODIFY_SOCIAL_FACTOR, + actionType, options: this.options, params: { ...defaultParams, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 54799665..323fec3a 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -53,6 +53,7 @@ export const AUTH_ACTIONS = { LOGIN: "login", ENABLE_MFA: "enable_mfa", MANAGE_MFA: "manage_mfa", + ADD_SOCIAL_FACTOR: "add_social_factor", MODIFY_SOCIAL_FACTOR: "modify_social_factor", ADD_AUTHENTICATOR_FACTOR: "add_authenticator_factor", ADD_PASSKEY_FACTOR: "add_passkey_factor",