add login redirect
This commit is contained in:
1 parent
a94be71c98
commit
2a5a5c601c
12 files changed
+113
-15
No files matched your search
+13
-5
@@ -1,10 +1,7 @@
|
||||
import { createStore, ActionContext } from 'vuex';
|
||||
import { IUser } from '@/services/common/user/types';
|
||||
|
||||
interface IUser {
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
export interface IState {
|
||||
count: number;
|
||||
accessToken: string | undefined;
|
||||
refreshToken: string | undefined;
|
||||
@@ -47,6 +44,17 @@ const store = createStore({
|
||||
setUser({ commit }: ActionContext<IState, IState>, payload: IUser) {
|
||||
commit('setUser', payload);
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
authenticated(state) {
|
||||
return !!state.accessToken;
|
||||
},
|
||||
accessToken(state) {
|
||||
return state.accessToken;
|
||||
},
|
||||
refreshToken(state) {
|
||||
return state.refreshToken;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user