aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/store/pageProtectionPlugin.ts
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-01-30 15:23:06 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-01-30 15:23:06 -0500
commit5abc489b9954111d66d1385aa62a3ea962fa0a55 (patch)
treeb1715e5c5e6316f33e3e33fb55397d93200ab518 /front-end/src/store/pageProtectionPlugin.ts
parente4dc63ded324c6e9678603296953bb1f7dea7569 (diff)
merge upstream. Add dynamic client-side support for optional oauth2 and social login methods
Diffstat (limited to 'front-end/src/store/pageProtectionPlugin.ts')
-rw-r--r--front-end/src/store/pageProtectionPlugin.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/front-end/src/store/pageProtectionPlugin.ts b/front-end/src/store/pageProtectionPlugin.ts
index 9831dad..a747e49 100644
--- a/front-end/src/store/pageProtectionPlugin.ts
+++ b/front-end/src/store/pageProtectionPlugin.ts
@@ -60,14 +60,12 @@ export const pageProtectionPlugin = (router: ReturnType<typeof useRouter>): Pini
return true;
})
- router.afterEach(() => {
- //scroll window back to top
- window.scrollTo(0, 0)
- })
+ //scroll window back to top
+ router.afterEach(() => window.scrollTo(0, 0))
- watch(loggedIn, (loggedIn) => {
+ watch(loggedIn, (li) => {
//If the user gets logged out, redirect to login
- if(loggedIn === false && router.currentRoute.value.name !== 'Login'){
+ if(li === false && router.currentRoute.value.name !== 'Login'){
router.push({ name: 'Login' })
}
})