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>
This commit is contained in:
Johann150
2022-06-29 11:26:06 +02:00
committed by GitHub
parent f997b7dff2
commit 7f111f4474
3 changed files with 34 additions and 1 deletions

View File

@@ -17,5 +17,5 @@ export function pleaseLogin(path?: string) {
},
}, 'closed');
throw new Error('signin required');
if (!path) throw new Error('signin required');
}