Client - redirect after login if redirection exists

This commit is contained in:
Sam
2021-11-03 09:41:27 +01:00
parent 987503ca96
commit fece99921b
19 changed files with 34 additions and 26 deletions

View File

@ -97,7 +97,11 @@ export const actions: ActionTree<IUserState, IRootState> & IUserActions = {
context.commit(USER_STORE.MUTATIONS.UPDATE_AUTH_TOKEN, token)
context
.dispatch(USER_STORE.ACTIONS.GET_USER_PROFILE)
.then(() => router.push('/'))
.then(() =>
router.push(
typeof data.redirectUrl === 'string' ? data.redirectUrl : '/'
)
)
} else {
handleError(context, null)
}