feat(api): Get current session

This commit is contained in:
Ferdinand Thiessen 2021-12-05 13:30:44 +01:00
parent 656d7a9e3c
commit 83f32ea82a
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ export const useMainStore = defineStore({
if (this.user === undefined) throw 'Not logged in, this should not be called'; if (this.user === undefined) throw 'Not logged in, this should not be called';
return this.user; return this.user;
}, },
currentSession(): FG.Session {
if (this.session === undefined) throw 'Not logged in, this should not be called';
return this.session;
},
permissions(): string[] { permissions(): string[] {
return this.user?.permissions || []; return this.user?.permissions || [];
}, },