fix(api): Load current user in login function of mainStore

This commit is contained in:
Ferdinand Thiessen 2021-12-05 13:33:02 +01:00
parent 83f32ea82a
commit 49c3ec74ba
1 changed files with 2 additions and 0 deletions

View File

@ -67,8 +67,10 @@ export const useMainStore = defineStore({
},
async login(userid: string, password: string) {
const userStore = useUserStore();
try {
const { data } = await api.post<FG.Session>('/auth', { userid, password });
this.user = await userStore.getUser(data.userid, true);
this.session = fixSession(data);
return true;
} catch ({ response }) {