Skip to content

Commit 8ad3fd2

Browse files
add platform to params
1 parent 97e3f3d commit 8ad3fd2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/utils/constants.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,13 @@ export const BUILD_ENV = {
6666
STAGING: "staging",
6767
TESTING: "testing",
6868
} as const;
69+
70+
export const APP_PLATFORMS = {
71+
ANDROID: "android",
72+
IOS: "ios",
73+
NATIVE: "react-native",
74+
FLUTTER: "flutter",
75+
UNITY: "unity",
76+
UNREAL: "unreal",
77+
EMBED: "embed",
78+
} as const;

src/utils/interfaces.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type TORUS_LEGACY_NETWORK_TYPE, type TORUS_SAPPHIRE_NETWORK_TYPE } from "@toruslabs/constants";
22

3-
import { AUTH_ACTIONS, BUILD_ENV, LOGIN_PROVIDER, MFA_LEVELS, SUPPORTED_KEY_CURVES, UX_MODE, WEB3AUTH_NETWORK } from "./constants";
3+
import { APP_PLATFORMS, AUTH_ACTIONS, BUILD_ENV, LOGIN_PROVIDER, MFA_LEVELS, SUPPORTED_KEY_CURVES, UX_MODE, WEB3AUTH_NETWORK } from "./constants";
44

55
export type WEB3AUTH_LEGACY_NETWORK_TYPE = TORUS_LEGACY_NETWORK_TYPE;
66
export type WEB3AUTH_SAPPHIRE_NETWORK_TYPE = TORUS_SAPPHIRE_NETWORK_TYPE;
@@ -43,6 +43,8 @@ export type CUSTOM_LOGIN_PROVIDER_TYPE = string & { toString?: (radix?: number)
4343

4444
export type MfaLevelType = (typeof MFA_LEVELS)[keyof typeof MFA_LEVELS];
4545

46+
export type APP_PLATFORMS_TYPE = (typeof APP_PLATFORMS)[keyof typeof APP_PLATFORMS];
47+
4648
export type SUPPORTED_KEY_CURVES_TYPE = (typeof SUPPORTED_KEY_CURVES)[keyof typeof SUPPORTED_KEY_CURVES];
4749

4850
export type WEB3AUTH_NETWORK_TYPE = (typeof WEB3AUTH_NETWORK)[keyof typeof WEB3AUTH_NETWORK];
@@ -215,6 +217,12 @@ export type LoginParams = BaseRedirectParams & {
215217
*
216218
*/
217219
dappUrl?: string;
220+
221+
/**
222+
* Allows the dapp to set a platform for the manage mfa flow.
223+
*
224+
*/
225+
platform?: APP_PLATFORMS_TYPE;
218226
};
219227

220228
export type SocialMfaModParams = {

0 commit comments

Comments
 (0)