summaryrefslogtreecommitdiff
path: root/packages/client/src/scripts
diff options
context:
space:
mode:
authorJohann150 <johann.galle@protonmail.com>2022-06-29 11:26:06 +0200
committerGitHub <noreply@github.com>2022-06-29 18:26:06 +0900
commit7f111f4474f20f9bdda0d5c884b1b5cd09ff2628 (patch)
tree348d4211c989dcbaba4cefc84b01c39b01562f5c /packages/client/src/scripts
parentchore(client): fix type def (diff)
downloadsharkey-7f111f4474f20f9bdda0d5c884b1b5cd09ff2628.tar.gz
sharkey-7f111f4474f20f9bdda0d5c884b1b5cd09ff2628.tar.bz2
sharkey-7f111f4474f20f9bdda0d5c884b1b5cd09ff2628.zip
Prevent access to user pages when not logged in [v2] (#8904)
* do not throw error when navigating * enhance: add loginRequired to router This allows client pages to require logging in before displaying the page, useful for example for user settings pages. * add login requirements Co-authored-by: Andreas Nedbal <git@pixelde.su>
Diffstat (limited to 'packages/client/src/scripts')
-rw-r--r--packages/client/src/scripts/please-login.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/client/src/scripts/please-login.ts b/packages/client/src/scripts/please-login.ts
index e21a6d2ed3..1f38061841 100644
--- a/packages/client/src/scripts/please-login.ts
+++ b/packages/client/src/scripts/please-login.ts
@@ -17,5 +17,5 @@ export function pleaseLogin(path?: string) {
},
}, 'closed');
- throw new Error('signin required');
+ if (!path) throw new Error('signin required');
}