mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
Merge pull request #27537 from nextcloud/fix/noid/webauthn-localhost
Allow WebAuthn on localhost as well
This commit is contained in:
commit
18ff2612a1
10 changed files with 37 additions and 15 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
8
core/js/dist/login.js
vendored
8
core/js/dist/login.js
vendored
File diff suppressed because one or more lines are too long
2
core/js/dist/login.js.map
vendored
2
core/js/dist/login.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<form v-if="isHttps && hasPublicKeyCredential"
|
||||
<form v-if="(isHttps || isLocalhost) && hasPublicKeyCredential"
|
||||
ref="loginForm"
|
||||
method="post"
|
||||
name="login"
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
<div v-else-if="!hasPublicKeyCredential">
|
||||
{{ t('core', 'Passwordless authentication is not supported in your browser.') }}
|
||||
</div>
|
||||
<div v-else-if="!isHttps">
|
||||
<div v-else-if="!isHttps && !isLocalhost">
|
||||
{{ t('core', 'Passwordless authentication is only available over a secure connection.') }}
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -73,6 +73,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isLocalhost: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasPublicKeyCredential: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ new View({
|
|||
hasPasswordless: fromStateOr('webauthn-available', false),
|
||||
countAlternativeLogins: fromStateOr('countAlternativeLogins', false),
|
||||
isHttps: window.location.protocol === 'https:',
|
||||
isLocalhost: window.location.hostname === 'localhost',
|
||||
hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined',
|
||||
hideLoginForm: fromStateOr('hideLoginForm', false),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@
|
|||
:inverted-colors="invertedColors"
|
||||
:auto-complete-allowed="autoCompleteAllowed"
|
||||
:is-https="isHttps"
|
||||
:is-localhost="isLocalhost"
|
||||
:has-public-key-credential="hasPublicKeyCredential"
|
||||
@submit="loading = true" />
|
||||
<a href="#" @click.prevent="passwordlessLogin = false">
|
||||
|
|
@ -176,6 +177,10 @@ export default {
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isLocalhost: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasPublicKeyCredential: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue