mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(web): continue after login (#18302)
This commit is contained in:
parent
6117329057
commit
c046651f23
34 changed files with 65 additions and 63 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue