mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-04-06 01:25:31 +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>
|
<script>
|
||||||
import LoginForm from '~/components/LoginForm/LoginForm.vue'
|
import LoginForm from '~/components/LoginForm/LoginForm.vue'
|
||||||
import { VERSION } from '~/constants/terms-and-conditions-version.js'
|
import { VERSION } from '~/constants/terms-and-conditions-version.js'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
layout: 'no-header',
|
layout: 'no-header',
|
||||||
components: {
|
components: {
|
||||||
LoginForm,
|
LoginForm,
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
user: 'auth/user',
|
||||||
|
}),
|
||||||
|
},
|
||||||
asyncData({ store, redirect }) {
|
asyncData({ store, redirect }) {
|
||||||
if (store.getters['auth/user'].termsAndConditionsAgreedVersion === VERSION) {
|
if (store.getters['auth/user'].termsAndConditionsAgreedVersion === VERSION) {
|
||||||
redirect('/')
|
redirect('/')
|
||||||
@ -20,6 +26,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSuccess() {
|
handleSuccess() {
|
||||||
|
this.$i18n.set(this.user.locale || 'en')
|
||||||
this.$router.replace(this.$route.query.path || '/')
|
this.$router.replace(this.$route.query.path || '/')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -84,6 +84,7 @@ export const actions = {
|
|||||||
role
|
role
|
||||||
about
|
about
|
||||||
locationName
|
locationName
|
||||||
|
locale
|
||||||
contributionsCount
|
contributionsCount
|
||||||
commentedCount
|
commentedCount
|
||||||
allowEmbedIframes
|
allowEmbedIframes
|
||||||
|
|||||||
@ -13,6 +13,7 @@ const currentUser = {
|
|||||||
email: 'user@example.org',
|
email: 'user@example.org',
|
||||||
avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/mutu_krish/128.jpg',
|
avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/mutu_krish/128.jpg',
|
||||||
role: 'user',
|
role: 'user',
|
||||||
|
locale: 'de',
|
||||||
}
|
}
|
||||||
const successfulLoginResponse = { data: { login: token } }
|
const successfulLoginResponse = { data: { login: token } }
|
||||||
const successfulCurrentUserResponse = { data: { currentUser } }
|
const successfulCurrentUserResponse = { data: { currentUser } }
|
||||||
@ -126,6 +127,7 @@ describe('actions', () => {
|
|||||||
email: 'user@example.org',
|
email: 'user@example.org',
|
||||||
avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/mutu_krish/128.jpg',
|
avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/mutu_krish/128.jpg',
|
||||||
role: 'user',
|
role: 'user',
|
||||||
|
locale: 'de',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
]),
|
]),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user