feat(dev): add u2f ui for managing devices and signing in (#2182)

* feat: add u2f ui for managing devices and signing in

* refactor: change unnecessary useState to derived constant

* fix: modal refactor

* fix(web): hide u2f under feature trunk

* fix(web): jest setup

---------

Co-authored-by: Aman Harwara <amanharwara@protonmail.com>
This commit is contained in:
Karol Sójko
2023-02-03 07:54:56 +01:00
committed by GitHub
parent b4f14c668d
commit 9414774e89
48 changed files with 552 additions and 190 deletions

View File

@@ -20,6 +20,7 @@ export class ChallengePrompt implements ChallengePromptInterface {
public readonly secureTextEntry = true,
public readonly keyboardType?: ChallengeKeyboardType,
public readonly initialValue?: ChallengeRawValue,
public readonly contextData?: Record<string, unknown>,
) {
switch (this.validation) {
case ChallengeValidation.AccountPassword:
@@ -37,6 +38,11 @@ export class ChallengePrompt implements ChallengePromptInterface {
this.placeholder = placeholder ?? ''
this.validates = true
break
case ChallengeValidation.Authenticator:
this.title = title ?? ChallengePromptTitle.U2F
this.placeholder = placeholder ?? ''
this.validates = true
break
case ChallengeValidation.ProtectionSessionDuration:
this.title = title ?? ChallengePromptTitle.RememberFor
this.placeholder = placeholder ?? ''

View File

@@ -6,4 +6,5 @@ export const ChallengePromptTitle = {
Biometrics: 'Biometrics',
RememberFor: 'Remember For',
Mfa: 'Two-factor Authentication Code',
U2F: 'Security Key',
}

View File

@@ -1,3 +1,3 @@
/* istanbul ignore file */
export type ChallengeRawValue = number | string | boolean
export type ChallengeRawValue = number | string | boolean | Record<string, unknown>

View File

@@ -6,4 +6,5 @@ export enum ChallengeValidation {
AccountPassword = 2,
Biometric = 3,
ProtectionSessionDuration = 4,
Authenticator = 5,
}