mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
fix(web): redirect to login (#25254)
This commit is contained in:
parent
f194a7ea3e
commit
38f01a6b7d
3 changed files with 8 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ import { AppRoute } from '../constants';
|
||||||
|
|
||||||
export interface AuthOptions {
|
export interface AuthOptions {
|
||||||
admin?: true;
|
admin?: true;
|
||||||
public?: true;
|
public?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const loadUser = async () => {
|
export const loadUser = async () => {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { authenticate } from '$lib/utils/auth';
|
||||||
|
import { getAssetInfoFromParam, isSharedLinkRoute } from '$lib/utils/navigation';
|
||||||
import type { LayoutLoad } from './$types';
|
import type { LayoutLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ url, params, route }) => {
|
||||||
|
await authenticate(url, { public: isSharedLinkRoute(route.id) });
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import { systemConfigManager } from '$lib/managers/system-config-manager.svelte';
|
import { systemConfigManager } from '$lib/managers/system-config-manager.svelte';
|
||||||
|
import { authenticate } from '$lib/utils/auth';
|
||||||
import type { LayoutLoad } from './$types';
|
import type { LayoutLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
|
await authenticate(url, { admin: true });
|
||||||
await systemConfigManager.init();
|
await systemConfigManager.init();
|
||||||
}) satisfies LayoutLoad;
|
}) satisfies LayoutLoad;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue