From d9e260dce73726e310dd7f38cedf47121c02b077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=91=D0=B0=D1=82=D1=83=D0=B5?= =?UTF-8?q?=D0=B2?= Date: Fri, 27 Dec 2024 14:16:14 +0300 Subject: [PATCH] added token fix for app view --- src/views/apps/ApplicationFrame.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/apps/ApplicationFrame.vue b/src/views/apps/ApplicationFrame.vue index 2bd3996..8a5b48d 100644 --- a/src/views/apps/ApplicationFrame.vue +++ b/src/views/apps/ApplicationFrame.vue @@ -96,7 +96,7 @@ const getToken = async () => { if (storageToken) { return storageToken; } else { - const expiresDate = new Date(Date.now() + msInHour / 60); + const expiresDate = new Date(Date.now() + msInHour); const { data } = await apiClient.POST('/auth/session', { body: { scopes: scopes.value.length == 0 ? [] : scopes.value, @@ -156,6 +156,11 @@ const openApp = async (data: ServiceData) => { }; onMounted(async () => { + if (history.state.token) { + profileStore.updateToken(history.state.token); + delete history.state.token; + } + const { data } = await apiClient.GET('/services/service/{button_id}', { params: { path: { button_id: appId } }, });