adminforth 1.5.8-next.21 → 1.5.8-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,6 +10,7 @@ export const useUserStore = defineStore('user', () => {
|
|
|
10
10
|
const isAuthorized = ref(false);
|
|
11
11
|
|
|
12
12
|
function authorize() {
|
|
13
|
+
// syncing isAuthorized allows us to use navigation guards without waiting for user api response
|
|
13
14
|
isAuthorized.value = true;
|
|
14
15
|
localStorage.setItem('isAuthorized', 'true');
|
|
15
16
|
}
|
|
@@ -21,9 +22,14 @@ export const useUserStore = defineStore('user', () => {
|
|
|
21
22
|
|
|
22
23
|
async function finishLogin() {
|
|
23
24
|
const coreStore = useCoreStore();
|
|
24
|
-
authorize();
|
|
25
|
+
authorize();
|
|
25
26
|
reconnect();
|
|
26
|
-
|
|
27
|
+
// if next param in route, redirect to it
|
|
28
|
+
if (router.currentRoute.value.query.next) {
|
|
29
|
+
await router.push(router.currentRoute.value.query.next.toString());
|
|
30
|
+
} else {
|
|
31
|
+
await router.push('/');
|
|
32
|
+
}
|
|
27
33
|
await router.isReady();
|
|
28
34
|
await coreStore.fetchMenuAndResource();
|
|
29
35
|
}
|