diff --git a/frontend/public/config.json b/frontend/public/config.json index 59e06a1dc..7c7f4ef46 100644 --- a/frontend/public/config.json +++ b/frontend/public/config.json @@ -1,7 +1,7 @@ { - "API_BASE_URL": "/api/v2/", - "API_DOC_URL": "/api/schema-v2/swagger/", - "OAUTH_AUTHORITY_URL": "https://localhost:8000/api/o", - "OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD", - "OAUTH_REDIRECT_URI": "https://localhost:3000/login/logged" + "API_BASE_URL": "/api/v2/", + "API_DOC_URL": "/api/schema-v2/swagger/", + "OAUTH_AUTHORITY_URL": "https://localhost:8000/api/o", + "OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD", + "OAUTH_REDIRECT_URI": "https://localhost:3000/login/logged" } diff --git a/frontend/src/api/auth.js b/frontend/src/api/auth.js index a48b56cdd..14beca4c3 100644 --- a/frontend/src/api/auth.js +++ b/frontend/src/api/auth.js @@ -24,5 +24,5 @@ export default { }, deleteFido(id) { return repository.delete(`/fido/${id}/`) - } + }, } diff --git a/frontend/src/components/account/BackupCodeAuthForm.vue b/frontend/src/components/account/BackupCodeAuthForm.vue new file mode 100644 index 000000000..e94d1f41f --- /dev/null +++ b/frontend/src/components/account/BackupCodeAuthForm.vue @@ -0,0 +1,116 @@ + + + diff --git a/frontend/src/components/account/FidoAuthForm.vue b/frontend/src/components/account/FidoAuthForm.vue index 6568d1bdc..2c1995e6b 100644 --- a/frontend/src/components/account/FidoAuthForm.vue +++ b/frontend/src/components/account/FidoAuthForm.vue @@ -16,33 +16,8 @@ ) }} - - - +

{{ $gettext('Registered Webauthn devices') }}

+ + + + @@ -95,7 +102,7 @@ @@ -153,16 +160,21 @@ async function startFidoRegistration() { const creationOption = await authApi.beginFidoRegistration() if (creationOption) { const options = parseCreationOptionsFromJSON(creationOption.data) - const device = await create(options) - const result = device.toJSON() - result.name = name.value - authStore.addFidoCred(result).then((res) => { - if (res.status === 200) { - tokens.value = res.data.tokens - showBackupTokenDialog.value = true - } - }) - fidoForm.value.reset() + try { + const device = await create(options) + const result = device.toJSON() + result.name = name.value + authStore.addFidoCred(result).then((res) => { + if (res.status === 200) { + tokens.value = res.data.tokens + showBackupTokenDialog.value = true + } + }) + fidoForm.value.reset() + } catch { + registrationLoading.value = false + return + } } registrationLoading.value = false } diff --git a/frontend/src/components/account/TwoFactorAuthForm.vue b/frontend/src/components/account/TotpAuthForm.vue similarity index 71% rename from frontend/src/components/account/TwoFactorAuthForm.vue rename to frontend/src/components/account/TotpAuthForm.vue index 833594fab..f9860dee2 100644 --- a/frontend/src/components/account/TwoFactorAuthForm.vue +++ b/frontend/src/components/account/TotpAuthForm.vue @@ -47,7 +47,7 @@
-