Skip to content

Commit

Permalink
Merge pull request #428 from sparcs-kaist/fix/logout
Browse files Browse the repository at this point in the history
Fix/logout
  • Loading branch information
000wan authored Nov 22, 2023
2 parents 81eda6e + 8086d1c commit 2ff22fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/router/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { acquireFCMToken, releaseFCMToken } from '@/firebase'

export const authGuard = async (to, from, next) => {
await store.dispatch('fetchMe')

if (!store.getters.isLoggedIn) {
const urlRef = (to.path && to.path !== '/') ? `?next=${location.protocol}//${location.host}${to.fullPath}` : `?next=${location.protocol}//${location.host}/`
next(`/login${urlRef}`)
Expand Down Expand Up @@ -67,6 +66,7 @@ export default [
await logout(store.getters.userId)
} catch (err) {}
store.commit('setAuthState', false)
store.commit('setUserProfile', {})
}

next('/login')
Expand Down

0 comments on commit 2ff22fb

Please sign in to comment.