diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-07-22 13:21:25 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-07-22 13:21:25 +0200 |
commit | 7ca81f360f42341b2941798374160d362507ba26 (patch) | |
tree | a3d4701504898e6c864980b989b78fc88ed92fbd /core/src/views/Login.vue | |
parent | 49b490ce6d1d726aa1c335b0b5c440d8a3cae5ff (diff) | |
download | nextcloud-server-7ca81f360f42341b2941798374160d362507ba26.tar.gz nextcloud-server-7ca81f360f42341b2941798374160d362507ba26.zip |
Fix eslint and update bundles
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/src/views/Login.vue')
-rw-r--r-- | core/src/views/Login.vue | 102 |
1 files changed, 36 insertions, 66 deletions
diff --git a/core/src/views/Login.vue b/core/src/views/Login.vue index 1372f40b112..f7a96514afe 100644 --- a/core/src/views/Login.vue +++ b/core/src/views/Login.vue @@ -111,91 +111,61 @@ </template> <script> +import { loadState } from '@nextcloud/initial-state' +import queryString from 'query-string' + import LoginForm from '../components/login/LoginForm.vue' import PasswordLessLoginForm from '../components/login/PasswordLessLoginForm.vue' import ResetPassword from '../components/login/ResetPassword.vue' import UpdatePassword from '../components/login/UpdatePassword.vue' +const query = queryString.parse(location.search) +if (query.clear === '1') { + try { + window.localStorage.clear() + window.sessionStorage.clear() + console.debug('Browser storage cleared') + } catch (e) { + console.error('Could not clear browser storage', e) + } +} + export default { name: 'Login', + components: { LoginForm, PasswordLessLoginForm, ResetPassword, UpdatePassword, }, - props: { - username: { - type: String, - default: '', - }, - redirectUrl: { - type: String, - }, - errors: { - type: Array, - default: () => [], - }, - messages: { - type: Array, - default: () => [], - }, - throttleDelay: { - type: Number, - }, - canResetPassword: { - type: Boolean, - default: false, - }, - resetPasswordLink: { - type: String, - }, - resetPasswordTarget: { - type: String, - }, - invertedColors: { - type: Boolean, - default: false, - }, - autoCompleteAllowed: { - type: Boolean, - default: true, - }, - directLogin: { - type: Boolean, - default: false, - }, - hasPasswordless: { - type: Boolean, - default: false, - }, - countAlternativeLogins: { - type: Number, - default: 0, - }, - isHttps: { - type: Boolean, - default: false, - }, - isLocalhost: { - type: Boolean, - default: false, - }, - hasPublicKeyCredential: { - type: Boolean, - default: false, - }, - hideLoginForm: { - type: Boolean, - default: false, - }, - }, + data() { return { loading: false, user: this.username, passwordlessLogin: false, resetPassword: false, + + // Initial data + errors: loadState('core', 'loginErrors', []), + messages: loadState('core', 'loginMessages', []), + redirectUrl: loadState('core', 'loginRedirectUrl', undefined), + username: loadState('core', 'loginUsername', ''), + throttleDelay: loadState('core', 'loginThrottleDelay', 0), + invertedColors: OCA.Theming && OCA.Theming.inverted, + canResetPassword: loadState('core', 'loginCanResetPassword', false), + resetPasswordLink: loadState('core', 'loginResetPasswordLink', ''), + autoCompleteAllowed: loadState('core', 'loginAutocomplete', true), + resetPasswordTarget: loadState('core', 'resetPasswordTarget', ''), + resetPasswordUser: loadState('core', 'resetPasswordUser', ''), + directLogin: query.direct === '1', + hasPasswordless: loadState('core', 'webauthn-available', false), + countAlternativeLogins: loadState('core', 'countAlternativeLogins', false), + isHttps: window.location.protocol === 'https:', + isLocalhost: window.location.hostname === 'localhost', + hasPublicKeyCredential: typeof (window.PublicKeyCredential) !== 'undefined', + hideLoginForm: loadState('core', 'hideLoginForm', false), } }, methods: { |