mirror of
https://github.com/kevin-DL/comedy-video-lib.git
synced 2026-01-22 23:35:18 +00:00
Profile page
- Created a mock profile page
This commit is contained in:
@@ -168,15 +168,16 @@ export default {
|
||||
this.$store.commit('auth/setLoggedIn', token !== null)
|
||||
|
||||
if (token) {
|
||||
const profile = await this.$api.$get('/api/profiles/1').catch((err) => {
|
||||
console.log(err)
|
||||
const profile = await this.$api.$get('/profile').catch((err) => {
|
||||
return null
|
||||
})
|
||||
if (!profile) {
|
||||
await this.$router.push('/profile/setup')
|
||||
} else {
|
||||
this.$store.commit('auth/setProfile', profile)
|
||||
await this.$router.push('/')
|
||||
} else {
|
||||
this.$store.commit('auth/setProfile', profile.data)
|
||||
const redFrom = this.$store.state.routing.redirectedFrom
|
||||
this.$store.commit('routing/setRedirectedFrom', null)
|
||||
await this.$router.push(redFrom || '/')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user