feat: recovery codes UI (recovery sign in + get recovery codes) (#2139)

* feat(web): show recovery codes

* feat(web): add recovery sign in

* fix: copy

* fix: styles

* feat: add "copy to clipboard" button

* style: copy

* fix: copy button bg

* style: singularize recovery codes

* style: singularize recovery codes

* feat: password validation

Co-authored-by: Aman Harwara <amanharwara@protonmail.com>
Co-authored-by: Mo <mo@standardnotes.com>
This commit is contained in:
Karol Sójko
2023-01-10 21:33:44 +01:00
committed by GitHub
parent de3fa476c7
commit 5e6c901c21
16 changed files with 234 additions and 32 deletions

View File

@@ -17,7 +17,7 @@ describe('GetRecoveryCodes', () => {
settingsClient.getSetting = jest.fn().mockResolvedValue('existing-recovery-codes')
})
it('should return existing recovery codes if they exist', async () => {
it('should return existing recovery code if they exist', async () => {
const useCase = createUseCase()
const result = await useCase.execute()
@@ -25,7 +25,7 @@ describe('GetRecoveryCodes', () => {
expect(result.getValue()).toBe('existing-recovery-codes')
})
it('should generate recovery codes if they do not exist', async () => {
it('should generate recovery code if they do not exist', async () => {
settingsClient.getSetting = jest.fn().mockResolvedValue(undefined)
const useCase = createUseCase()
@@ -35,7 +35,7 @@ describe('GetRecoveryCodes', () => {
expect(result.getValue()).toBe('recovery-codes')
})
it('should return error if recovery codes could not be generated', async () => {
it('should return error if recovery code could not be generated', async () => {
settingsClient.getSetting = jest.fn().mockResolvedValue(undefined)
authClient.generateRecoveryCodes = jest.fn().mockResolvedValue(false)