diff options
Diffstat (limited to 'apps/settings/src')
-rw-r--r-- | apps/settings/src/components/WebAuthn/AddDevice.vue | 6 | ||||
-rw-r--r-- | apps/settings/src/components/WebAuthn/Section.vue | 9 | ||||
-rw-r--r-- | apps/settings/src/main-personal-webauth.js | 1 |
3 files changed, 14 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, diff --git a/apps/settings/src/main-personal-webauth.js b/apps/settings/src/main-personal-webauth.js index 81d153092c5..ac1f3befa9d 100644 --- a/apps/settings/src/main-personal-webauth.js +++ b/apps/settings/src/main-personal-webauth.js @@ -36,6 +36,7 @@ new View({ propsData: { initialDevices: devices, isHttps: window.location.protocol === 'https:', + isLocalhost: window.location.hostname === 'localhost', hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined', }, }).$mount('#security-webauthn') |