18.08 Redirect on Log In Log Out
This commit is contained in:
parent
27563c4d21
commit
60f0dcf11a
@ -41,7 +41,7 @@ export default {
|
||||
name: 'Auth',
|
||||
data () {
|
||||
return {
|
||||
tab: 'register'
|
||||
tab: 'login'
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -33,11 +33,13 @@ const actions = {
|
||||
firebaseAuth.signOut()
|
||||
},
|
||||
handleAuthStateChange ({ commit }) {
|
||||
firebaseAuth.onAuthStateChanged(function (user) {
|
||||
firebaseAuth.onAuthStateChanged(user => {
|
||||
if (user) {
|
||||
commit('setLoggedIn', true)
|
||||
this.$router.push('/')
|
||||
} else {
|
||||
commit('setLoggedIn', false)
|
||||
this.$router.replace('/auth')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user