mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Merge pull request #2073 from Human-Connection/Laod_saved_Laguage_and_select
1931 - after successful login the saved language of the user is set
This commit is contained in:
commit
52bdfa7c48
@ -7,12 +7,18 @@
|
||||
<script>
|
||||
import LoginForm from '~/components/LoginForm/LoginForm.vue'
|
||||
import { VERSION } from '~/constants/terms-and-conditions-version.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
layout: 'no-header',
|
||||
components: {
|
||||
LoginForm,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
user: 'auth/user',
|
||||
}),
|
||||
},
|
||||
asyncData({ store, redirect }) {
|
||||
if (store.getters['auth/user'].termsAndConditionsAgreedVersion === VERSION) {
|
||||
redirect('/')
|
||||
@ -20,6 +26,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleSuccess() {
|
||||
this.$i18n.set(this.user.locale || 'en')
|
||||
this.$router.replace(this.$route.query.path || '/')
|
||||
},
|
||||
},
|
||||
|
||||
@ -84,6 +84,7 @@ export const actions = {
|
||||
role
|
||||
about
|
||||
locationName
|
||||
locale
|
||||
contributionsCount
|
||||
commentedCount
|
||||
allowEmbedIframes
|
||||
|
||||
@ -13,6 +13,7 @@ const currentUser = {
|
||||
email: 'user@example.org',
|
||||
avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/mutu_krish/128.jpg',
|
||||
role: 'user',
|
||||
locale: 'de',
|
||||
}
|
||||
const successfulLoginResponse = { data: { login: token } }
|
||||
const successfulCurrentUserResponse = { data: { currentUser } }
|
||||
@ -126,6 +127,7 @@ describe('actions', () => {
|
||||
email: 'user@example.org',
|
||||
avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/mutu_krish/128.jpg',
|
||||
role: 'user',
|
||||
locale: 'de',
|
||||
},
|
||||
],
|
||||
]),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user