You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-06-30 05:29:30 +02:00
feat: use <a> tag for albums in list view (#5645)
* fix: multiple improvements * pr feedback * optimize
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { api } from '@api';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import { AppRoute } from '../constants';
|
||||
import { getSavedUser, setUser } from '$lib/stores/user.store';
|
||||
|
||||
export interface AuthOptions {
|
||||
admin?: true;
|
||||
@ -19,7 +20,9 @@ export const getAuthUser = async () => {
|
||||
export const authenticate = async (options?: AuthOptions) => {
|
||||
options = options || {};
|
||||
|
||||
const user = await getAuthUser();
|
||||
const savedUser = getSavedUser();
|
||||
const user = savedUser || (await getAuthUser());
|
||||
|
||||
if (!user) {
|
||||
throw redirect(302, AppRoute.AUTH_LOGIN);
|
||||
}
|
||||
@ -28,6 +31,10 @@ export const authenticate = async (options?: AuthOptions) => {
|
||||
throw redirect(302, AppRoute.PHOTOS);
|
||||
}
|
||||
|
||||
if (!savedUser) {
|
||||
setUser(user);
|
||||
}
|
||||
|
||||
return user;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user