diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-06-17 11:01:31 +0300 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2021-06-17 17:05:45 +0300 |
commit | 86080e68b2a23b0759d81509c3bf47ad254f5ce7 (patch) | |
tree | c4886a91c932e2228456a2224c250321b49ebd1d /apps/settings/src/components/WebAuthn | |
parent | ff8cfbb24e49540362c9d9683c14daa40d07f495 (diff) |
Allow WebAuthn on localhost as well
* browsers typically whiteliste this as well - https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API
* for developing purposes see https://developer.chrome.com/docs/devtools/webauthn/
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/settings/src/components/WebAuthn')
-rw-r--r-- | apps/settings/src/components/WebAuthn/AddDevice.vue | 6 | ||||
-rw-r--r-- | apps/settings/src/components/WebAuthn/Section.vue | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/apps/settings/src/components/WebAuthn/AddDevice.vue b/apps/settings/src/components/WebAuthn/AddDevice.vue index 722c28b5147..463f5d9029a 100644 --- a/apps/settings/src/components/WebAuthn/AddDevice.vue +++ b/apps/settings/src/components/WebAuthn/AddDevice.vue @@ -20,7 +20,7 @@ --> <template> - <div v-if="!isHttps"> + <div v-if="!isHttps && !isLocalhost"> {{ t('settings', 'Passwordless authentication requires a secure connection.') }} </div> <div v-else> @@ -89,6 +89,10 @@ export default { type: Boolean, default: false, }, + isLocalhost: { + type: Boolean, + default: false, + }, }, data() { return { diff --git a/apps/settings/src/components/WebAuthn/Section.vue b/apps/settings/src/components/WebAuthn/Section.vue index e830b4fc743..56832e4eea3 100644 --- a/apps/settings/src/components/WebAuthn/Section.vue +++ b/apps/settings/src/components/WebAuthn/Section.vue @@ -40,7 +40,10 @@ {{ t('settings', 'Your browser does not support WebAuthn.') }} </p> - <AddDevice v-if="hasPublicKeyCredential" :is-https="isHttps" @added="deviceAdded" /> + <AddDevice v-if="hasPublicKeyCredential" + :is-https="isHttps" + :is-localhost="isLocalhost" + @added="deviceAdded" /> </div> </template> @@ -69,6 +72,10 @@ export default { type: Boolean, default: false, }, + isLocalhost: { + type: Boolean, + default: false, + }, hasPublicKeyCredential: { type: Boolean, default: false, |