Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/twofactor_nextcloud_notification-challenge.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions js/twofactor_nextcloud_notification-challenge.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SPDX-FileCopyrightText: escape-html developers
SPDX-FileCopyrightText: Tobias Koppers @sokra
SPDX-FileCopyrightText: T. Jameson Little <t.jameson.little@gmail.com>
SPDX-FileCopyrightText: Roman Shtylman <shtylman@gmail.com>
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: Joas Schilling <coding@schilljs.com>
SPDX-FileCopyrightText: Guillaume Chau
SPDX-FileCopyrightText: GitHub Inc.
Expand All @@ -17,6 +18,9 @@ This file is generated from multiple sources. Included packages:
- semver
- version: 7.7.3
- license: ISC
- @nextcloud/vue
- version: 9.13.0
- license: AGPL-3.0-or-later
- @vue/devtools-api
- version: 6.6.4
- license: MIT
Expand Down
2 changes: 1 addition & 1 deletion js/twofactor_nextcloud_notification-challenge.js.map

Large diffs are not rendered by default.

43 changes: 32 additions & 11 deletions src/components/Challenge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@
-->

<template>
<p v-if="state === State.POLLING">
{{ t('twofactor_nextcloud_notification', 'Please accept the request on one of your logged in devices.') }}
{{ t('twofactor_nextcloud_notification', 'You will be redirected automatically once this login has been accepted.') }}
</p>
<p v-else-if="state === State.VERIFYING">
<span class="icon-loading-small" />
<div v-if="state === State.POLLING" class="challenge-polling">
<p>
{{ t('twofactor_nextcloud_notification', 'Approve this login on one of your other devices.') }}
</p>
<NcLoadingIcon :size="32" />
</div>
<p v-else-if="state === State.VERIFYING" class="challenge-verifying">
<NcLoadingIcon />
{{ t('twofactor_nextcloud_notification', 'Please wait …') }}
</p>
<p v-else-if="state === State.REJECTED">
<span class="icon-loading-small" />
{{ t('twofactor_nextcloud_notification', 'Your login attempt was rejected.') }}
</p>
</template>

<script>
import { t } from '@nextcloud/l10n'
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
import { challengeOnLoginForm } from '../services/ChallengeService.js'

const State = Object.freeze({
Expand All @@ -33,6 +35,10 @@ export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'Challenge',

components: {
NcLoadingIcon,
},

data() {
return {
state: State.POLLING,
Expand All @@ -52,9 +58,24 @@ export default {
</script>

<style scoped>
.icon-loading-small {
display: inline-block;
vertical-align: sub;
padding-right: 12px;
.challenge-polling {
display: flex;
flex-direction: column;
align-items: center;
gap: calc(3 * var(--default-grid-baseline));

p {
font-size: 1.5em;
font-weight: bold;
text-align: center;
line-height: 1em;
}
}

.challenge-verifying {
display: flex;
align-items: center;
justify-content: center;
gap: calc(2 * var(--default-grid-baseline));
}
</style>
Loading