From 83f32ea82a31687bed31fa84a469d33f474b5879 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 5 Dec 2021 13:30:44 +0100 Subject: [PATCH] feat(api): Get current session --- api/src/stores/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/stores/main.ts b/api/src/stores/main.ts index 835b56a..172797c 100644 --- a/api/src/stores/main.ts +++ b/api/src/stores/main.ts @@ -38,6 +38,10 @@ export const useMainStore = defineStore({ if (this.user === undefined) throw 'Not logged in, this should not be called'; return this.user; }, + currentSession(): FG.Session { + if (this.session === undefined) throw 'Not logged in, this should not be called'; + return this.session; + }, permissions(): string[] { return this.user?.permissions || []; },