Skip to content
Snippets Groups Projects
Commit 51e94b5b authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Get user only if token is set

parent f33ebf42
No related branches found
No related tags found
1 merge request!14Update: Handle Login (coscine/issues#1833)
Pipeline #648470 passed
......@@ -67,11 +67,13 @@ export const useMainStore = defineStore({
*/
actions: {
async retrieveUser() {
try {
this.user = (await UserApi.userGetUser()).data;
} catch {
console.error("Could not fetch user");
// TODO: Handle error
if (this.userLoggedIn) {
try {
this.user = (await UserApi.userGetUser()).data;
} catch {
console.error("Could not fetch user");
// TODO: Handle error
}
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment