aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/store
diff options
context:
space:
mode:
Diffstat (limited to 'front-end/src/store')
-rw-r--r--front-end/src/store/globalState.ts3
-rw-r--r--front-end/src/store/socialMfaPlugin.ts16
2 files changed, 7 insertions, 12 deletions
diff --git a/front-end/src/store/globalState.ts b/front-end/src/store/globalState.ts
index 9e700eb..26001c7 100644
--- a/front-end/src/store/globalState.ts
+++ b/front-end/src/store/globalState.ts
@@ -1,5 +1,4 @@
import 'pinia'
-import { shallowRef } from 'vue';
import { useAutoHeartbeat } from '@vnuge/vnlib.browser';
import { toRefs, useLocalStorage } from '@vueuse/core';
import { PiniaPluginContext, PiniaPlugin } from 'pinia'
@@ -22,7 +21,7 @@ export const globalStatePlugin: PiniaPlugin = ({ store }: PiniaPluginContext) =>
const { ahEnabled } = toRefs(mainState)
//Setup heartbeat for 5 minutes
- useAutoHeartbeat(shallowRef(5 * 60 * 1000), ahEnabled)
+ useAutoHeartbeat(5 * 60 * 1000, ahEnabled)
return{
autoHeartbeat: ahEnabled,
diff --git a/front-end/src/store/socialMfaPlugin.ts b/front-end/src/store/socialMfaPlugin.ts
index 2f78f3a..79cb088 100644
--- a/front-end/src/store/socialMfaPlugin.ts
+++ b/front-end/src/store/socialMfaPlugin.ts
@@ -1,11 +1,10 @@
-
import 'pinia'
import { MaybeRef } from 'vue';
import {
useUser,
useOauthLogin,
- useSocialDefaultLogout,
- fetchSocialPortals,
+ useSocialDefaultLogout,
+ fetchSocialPortals,
fromSocialPortals,
fromSocialConnections,
} from '@vnuge/vnlib.browser'
@@ -41,25 +40,22 @@ export const socialMfaPlugin = (portalEndpoint?: MaybeRef<string>): PiniaPlugin
}
/*
- Try to load social methods from server, if it fails, then we will
- fall back to default
+ Try to load social methods from server, if it fails, then we will
+ fall back to default
*/
defer(async () => {
try {
-
+
const portals = await fetchSocialPortals(get(portalEndpoint)!);
const social = fromSocialPortals(portals);
const methods = fromSocialConnections(social);
//Create social login from available portals
const login = useOauthLogin(methods);
-
- const socialOauth = useSocialDefaultLogout(login, logout);
-
- console.log(login.methods)
+ const socialOauth = useSocialDefaultLogout(login, logout);
resolve(socialOauth)
} catch (error) {