mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
* Make login, registration, password-reset layout brandable - Rename some variables related to this * Remove experimental code * add lodash types * fix build fix type --------- Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
44 lines
1.1 KiB
Vue
44 lines
1.1 KiB
Vue
<template>
|
|
<div class="login-page">
|
|
<transition name="fade" appear>
|
|
<login-form @success="handleSuccess" />
|
|
</transition>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import LoginForm from '~/components/LoginForm/LoginForm.vue'
|
|
import loginConstants from '~/constants/loginBranded.js'
|
|
import { VERSION } from '~/constants/terms-and-conditions-version.js'
|
|
import { mapGetters } from 'vuex'
|
|
|
|
export default {
|
|
layout: loginConstants.LAYOUT,
|
|
components: {
|
|
LoginForm,
|
|
},
|
|
computed: {
|
|
...mapGetters({
|
|
user: 'auth/user',
|
|
}),
|
|
},
|
|
asyncData({ store, redirect }) {
|
|
if (store.getters['auth/user'].termsAndConditionsAgreedVersion === VERSION) {
|
|
redirect('/')
|
|
}
|
|
},
|
|
methods: {
|
|
async handleSuccess() {
|
|
this.$i18n.set(this.user.locale || 'en')
|
|
|
|
try {
|
|
await this.$router.replace(this.$route.query.path || '/')
|
|
} catch (err) {
|
|
// throw new Error(`Problem handling something: ${err}.`);
|
|
// TODO this is causing trouble - most likely due to double redirect on terms&conditions
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|