We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89eb886 commit a3b2e79Copy full SHA for a3b2e79
src/lib/utils/auth.ts
@@ -8,7 +8,10 @@ import { page } from "$app/state";
8
*/
9
export function requireAuthUser(): boolean {
10
if (page.data.loginEnabled && !page.data.user) {
11
- goto(`${base}/login`, { invalidateAll: true });
+ const url = page.data.shared
12
+ ? `${base}/login?next=${encodeURIComponent(page.url.pathname + page.url.search)}`
13
+ : `${base}/login`;
14
+ goto(url, { invalidateAll: true });
15
return true;
16
}
17
return false;
0 commit comments