diff options
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/authMethod')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/authMethod/index.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/anastasis-webui/src/pages/home/authMethod/index.tsx b/packages/anastasis-webui/src/pages/home/authMethod/index.tsx index 07f6ec206..8b0126ce7 100644 --- a/packages/anastasis-webui/src/pages/home/authMethod/index.tsx +++ b/packages/anastasis-webui/src/pages/home/authMethod/index.tsx @@ -41,7 +41,13 @@ interface AuthMethodConfiguration { solve: (props: AuthMethodSolveProps) => VNode; skip?: boolean; } -export type KnownAuthMethods = "sms" | "email" | "post" | "question" | "video" | "totp" | "iban"; +// export type KnownAuthMethods = "sms" | "email" | "post" | "question" | "video" | "totp" | "iban"; + +const ALL_METHODS = ['sms', 'email', 'post', 'question', 'video' , 'totp', 'iban'] as const; +export type KnownAuthMethods = (typeof ALL_METHODS)[number]; +export function isKnownAuthMethods(value: string): value is KnownAuthMethods { + return ALL_METHODS.includes(value as KnownAuthMethods) +} type KnowMethodConfig = { [name in KnownAuthMethods]: AuthMethodConfiguration; |