Skip to content

Commit a3b2e79

Browse files
authored
Redirect to shared conversation after login (#1962)
use login?next=
1 parent 89eb886 commit a3b2e79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/utils/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import { page } from "$app/state";
88
*/
99
export function requireAuthUser(): boolean {
1010
if (page.data.loginEnabled && !page.data.user) {
11-
goto(`${base}/login`, { invalidateAll: true });
11+
const url = page.data.shared
12+
? `${base}/login?next=${encodeURIComponent(page.url.pathname + page.url.search)}`
13+
: `${base}/login`;
14+
goto(url, { invalidateAll: true });
1215
return true;
1316
}
1417
return false;

0 commit comments

Comments
 (0)