Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-04-22 16:27:58 +0300
committerGitHub <noreply@github.com>2021-04-22 16:27:58 +0300
commitda043e52c8f550aa845833f338951793387393a2 (patch)
tree137489004ad3e69360c8feb81ca337bfb2064f0e /core/src
parenta011b7021ef7153acce6978a1c65db0a8c7ec32d (diff)
parent69290781ff0a59e72c1cf7c9c3b1c6a5ffc2596a (diff)
Merge pull request #26586 from nextcloud/bugfix/noid/handle-device-login-like-an-alternative-login
Handle device login like an alternative login
Diffstat (limited to 'core/src')
-rw-r--r--core/src/login.js1
-rw-r--r--core/src/views/Login.vue28
2 files changed, 23 insertions, 6 deletions
diff --git a/core/src/login.js b/core/src/login.js
index 1b33c6dc5ae..c496c7476cf 100644
--- a/core/src/login.js
+++ b/core/src/login.js
@@ -69,6 +69,7 @@ new View({
resetPasswordUser: fromStateOr('resetPasswordUser', ''),
directLogin: query.direct === '1',
hasPasswordless: fromStateOr('webauthn-available', false),
+ countAlternativeLogins: fromStateOr('countAlternativeLogins', false),
isHttps: window.location.protocol === 'https:',
hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined',
hideLoginForm: fromStateOr('hideLoginForm', false),
diff --git a/core/src/views/Login.vue b/core/src/views/Login.vue
index 6218aa7fe8b..90c163fc3d5 100644
--- a/core/src/views/Login.vue
+++ b/core/src/views/Login.vue
@@ -46,11 +46,23 @@
{{ t('core', 'Forgot password?') }}
</a>
<br>
- <a v-if="hasPasswordless"
- href="#"
- @click.prevent="passwordlessLogin = true">
- {{ t('core', 'Log in with a device') }}
- </a>
+ <template v-if="hasPasswordless">
+ <div v-if="countAlternativeLogins"
+ class="alternative-logins">
+ <a v-if="hasPasswordless"
+ class="button"
+ :class="{ 'single-alt-login-option': countAlternativeLogins }"
+ href="#"
+ @click.prevent="passwordlessLogin = true">
+ {{ t('core', 'Log in with a device') }}
+ </a>
+ </div>
+ <a v-else
+ href="#"
+ @click.prevent="passwordlessLogin = true">
+ {{ t('core', 'Log in with a device') }}
+ </a>
+ </template>
</div>
<div v-else-if="!loading && passwordlessLogin"
key="reset"
@@ -63,7 +75,7 @@
:is-https="isHttps"
:has-public-key-credential="hasPublicKeyCredential"
@submit="loading = true" />
- <a @click.prevent="passwordlessLogin = false" href="#">
+ <a href="#" @click.prevent="passwordlessLogin = false">
{{ t('core', 'Back') }}
</a>
</div>
@@ -156,6 +168,10 @@ export default {
type: Boolean,
default: false,
},
+ countAlternativeLogins: {
+ type: Number,
+ default: 0,
+ },
isHttps: {
type: Boolean,
default: false,