Skip to content

Commit

Permalink
support for add social factor
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1995 committed Sep 13, 2024
1 parent 103f772 commit 1455c98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SessionManager } from "@toruslabs/session-manager";

import {
AUTH_ACTIONS,
AUTH_ACTIONS_TYPE,
AuthOptions,
AuthSessionConfig,
AuthSessionData,
Expand Down Expand Up @@ -336,7 +337,7 @@ export class Auth {
window.open(loginUrl, "_blank");
}

async changeSocialFactor(params: SocialMfaModParams & Partial<BaseRedirectParams>): Promise<boolean> {
async manageSocialFactor(actionType: AUTH_ACTIONS_TYPE, params: SocialMfaModParams & Partial<BaseRedirectParams>): Promise<boolean> {
if (!this.sessionId) throw LoginError.userNotLoggedIn();

// in case of redirect mode, redirect url will be dapp specified
Expand All @@ -346,7 +347,7 @@ export class Auth {
};

const dataObject: AuthSessionConfig = {
actionType: AUTH_ACTIONS.MODIFY_SOCIAL_FACTOR,
actionType,
options: this.options,
params: {
...defaultParams,
Expand Down
1 change: 1 addition & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1455c98

Please sign in to comment.