mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 01:11:16 +03:00
feat(web): continue after login (#18302)
This commit is contained in:
@@ -50,7 +50,7 @@ const hasAuthCookie = (): boolean => {
|
||||
return false;
|
||||
};
|
||||
|
||||
export const authenticate = async (options?: AuthOptions) => {
|
||||
export const authenticate = async (url: URL, options?: AuthOptions) => {
|
||||
const { public: publicRoute, admin: adminRoute } = options || {};
|
||||
const user = await loadUser();
|
||||
|
||||
@@ -59,7 +59,7 @@ export const authenticate = async (options?: AuthOptions) => {
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
redirect(302, AppRoute.AUTH_LOGIN);
|
||||
redirect(302, `${AppRoute.AUTH_LOGIN}?continue=${encodeURIComponent(url.pathname + url.search)}`);
|
||||
}
|
||||
|
||||
if (adminRoute && !user.isAdmin) {
|
||||
|
||||
Reference in New Issue
Block a user