aboutsummaryrefslogtreecommitdiff
path: root/packages/anastasis-webui/src/pages/home/authMethod/index.tsx
blob: 1e1d7bc034110275dfed8b668bc34cdc178c27d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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;
}
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
    
  }
}