summaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/pages/home/authMethod/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/anastasis-webui/src/pages/home/authMethod/index.tsx')
-rw-r--r--packages/anastasis-webui/src/pages/home/authMethod/index.tsx69
1 files changed, 69 insertions, 0 deletions
diff --git a/packages/anastasis-webui/src/pages/home/authMethod/index.tsx b/packages/anastasis-webui/src/pages/home/authMethod/index.tsx
new file mode 100644
index 000000000..7b0cce883
--- /dev/null
+++ b/packages/anastasis-webui/src/pages/home/authMethod/index.tsx
@@ -0,0 +1,69 @@
+import { h, VNode } from "preact";
+import { AuthMethodSetupProps } from "../AuthenticationEditorScreen";
+
+import { AuthMethodEmailSetup as EmailScreen } from "./AuthMethodEmailSetup";
+import { AuthMethodIbanSetup as IbanScreen } from "./AuthMethodIbanSetup";
+import { AuthMethodPostSetup as PostalScreen } from "./AuthMethodPostSetup";
+import { AuthMethodQuestionSetup as QuestionScreen } from "./AuthMethodQuestionSetup";
+import { AuthMethodSmsSetup as SmsScreen } from "./AuthMethodSmsSetup";
+import { AuthMethodTotpSetup as TotpScreen } from "./AuthMethodTotpSetup";
+import { AuthMethodVideoSetup as VideScreen } from "./AuthMethodVideoSetup";
+import postalIcon from '../../../assets/icons/auth_method/postal.svg';
+import questionIcon from '../../../assets/icons/auth_method/question.svg';
+import smsIcon from '../../../assets/icons/auth_method/sms.svg';
+import videoIcon from '../../../assets/icons/auth_method/video.svg';
+
+interface AuthMethodConfiguration {
+ icon: VNode;
+ label: string;
+ screen: (props: AuthMethodSetupProps) => VNode;
+ skip?: boolean;
+}
+export type KnownAuthMethods = "sms" | "email" | "post" | "question" | "video" | "totp" | "iban";
+
+type KnowMethodConfig = {
+ [name in KnownAuthMethods]: AuthMethodConfiguration;
+};
+
+export const authMethods: KnowMethodConfig = {
+ question: {
+ icon: <img src={questionIcon} />,
+ label: "Question",
+ screen: QuestionScreen
+ },
+ sms: {
+ icon: <img src={smsIcon} />,
+ label: "SMS",
+ screen: SmsScreen
+ },
+ email: {
+ icon: <i class="mdi mdi-email" />,
+ label: "Email",
+ screen: EmailScreen
+
+ },
+ iban: {
+ icon: <i class="mdi mdi-bank" />,
+ label: "IBAN",
+ screen: IbanScreen
+
+ },
+ post: {
+ icon: <img src={postalIcon} />,
+ label: "Physical mail",
+ screen: PostalScreen
+
+ },
+ totp: {
+ icon: <i class="mdi mdi-devices" />,
+ label: "TOTP",
+ screen: TotpScreen
+
+ },
+ video: {
+ icon: <img src={videoIcon} />,
+ label: "Video",
+ screen: VideScreen,
+ skip: true,
+ }
+} \ No newline at end of file