From 7f111f4474f20f9bdda0d5c884b1b5cd09ff2628 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 29 Jun 2022 11:26:06 +0200 Subject: 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 --- packages/client/src/scripts/please-login.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/client/src/scripts') 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'); } -- cgit v1.2.3-freya