We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b520db3 commit 9d48ca5Copy full SHA for 9d48ca5
1 file changed
src/store/modules/auth/index.ts
@@ -19,7 +19,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
19
const { toLogin, redirectFromLogin } = useRouterPush(false);
20
const { loading: loginLoading, startLoading, endLoading } = useLoading();
21
22
- const token = ref(getToken());
+ const token = ref('');
23
24
const userInfo: Api.Auth.UserInfo = reactive({
25
userId: '',
@@ -159,9 +159,10 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
159
}
160
161
async function initUserInfo() {
162
- const hasToken = getToken();
+ const maybeToken = getToken();
163
164
- if (hasToken) {
+ if (maybeToken) {
165
+ token.value = maybeToken;
166
const pass = await getUserInfo();
167
168
if (!pass) {
0 commit comments