mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04:00
feat(web): continue after login (#18302)
This commit is contained in:
parent
6117329057
commit
c046651f23
@ -50,7 +50,7 @@ const hasAuthCookie = (): boolean => {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const authenticate = async (options?: AuthOptions) => {
|
export const authenticate = async (url: URL, options?: AuthOptions) => {
|
||||||
const { public: publicRoute, admin: adminRoute } = options || {};
|
const { public: publicRoute, admin: adminRoute } = options || {};
|
||||||
const user = await loadUser();
|
const user = await loadUser();
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ export const authenticate = async (options?: AuthOptions) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
redirect(302, AppRoute.AUTH_LOGIN);
|
redirect(302, `${AppRoute.AUTH_LOGIN}?continue=${encodeURIComponent(url.pathname + url.search)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adminRoute && !user.isAdmin) {
|
if (adminRoute && !user.isAdmin) {
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAllAlbums } from '@immich/sdk';
|
import { getAllAlbums } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const sharedAlbums = await getAllAlbums({ shared: true });
|
const sharedAlbums = await getAllAlbums({ shared: true });
|
||||||
const albums = await getAllAlbums({});
|
const albums = await getAllAlbums({});
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
@ -3,8 +3,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
|||||||
import { getAlbumInfo } from '@immich/sdk';
|
import { getAlbumInfo } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const [album, asset] = await Promise.all([
|
const [album, asset] = await Promise.all([
|
||||||
getAlbumInfo({ id: params.albumId, withoutAssets: true }),
|
getAlbumInfo({ id: params.albumId, withoutAssets: true }),
|
||||||
getAssetInfoFromParam(params),
|
getAssetInfoFromParam(params),
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { activateProduct, getActivationKey } from '$lib/utils/license-utils';
|
|||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ url }) => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
|
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
const licenseKey = url.searchParams.get('licenseKey');
|
const licenseKey = url.searchParams.get('licenseKey');
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAllPeople, getExploreData } from '@immich/sdk';
|
import { getAllPeople, getExploreData } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const [items, response] = await Promise.all([getExploreData(), getAllPeople({ withHidden: false })]);
|
const [items, response] = await Promise.all([getExploreData(), getAllPeople({ withHidden: false })]);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import { buildTree, normalizeTreePath } from '$lib/utils/tree-utils';
|
|||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params, url }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
const user = await authenticate();
|
const user = await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
|||||||
import { getUser } from '@immich/sdk';
|
import { getUser } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
|
|
||||||
const partner = await getUser({ id: params.userId });
|
const partner = await getUser({ id: params.userId });
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAllPeople } from '@immich/sdk';
|
import { getAllPeople } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
|
|
||||||
const people = await getAllPeople({ withHidden: true });
|
const people = await getAllPeople({ withHidden: true });
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
@ -4,8 +4,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
|||||||
import { getPerson, getPersonStatistics } from '@immich/sdk';
|
import { getPerson, getPersonStatistics } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
|
|
||||||
const [person, statistics, asset] = await Promise.all([
|
const [person, statistics, asset] = await Promise.all([
|
||||||
getPerson({ id: params.personId }),
|
getPerson({ id: params.personId }),
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetsByCity } from '@immich/sdk';
|
import { getAssetsByCity } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const items = await getAssetsByCity();
|
const items = await getAssetsByCity();
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
|||||||
import { getMySharedLink, isHttpError } from '@immich/sdk';
|
import { getMySharedLink, isHttpError } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
const { key } = params;
|
const { key } = params;
|
||||||
await authenticate({ public: true });
|
await authenticate(url, { public: true });
|
||||||
|
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ import { authenticate } from '$lib/utils/auth';
|
|||||||
import { getFormatter } from '$lib/utils/i18n';
|
import { getFormatter } from '$lib/utils/i18n';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { PartnerDirection, getAllAlbums, getPartners } from '@immich/sdk';
|
import { PartnerDirection, getAllAlbums, getPartners } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const sharedAlbums = await getAllAlbums({ shared: true });
|
const sharedAlbums = await getAllAlbums({ shared: true });
|
||||||
const partners = await getPartners({ direction: PartnerDirection.SharedWith });
|
const partners = await getPartners({ direction: PartnerDirection.SharedWith });
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
@ -7,7 +7,7 @@ import { getAllTags } from '@immich/sdk';
|
|||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params, url }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getApiKeys, getSessions } from '@immich/sdk';
|
import { getApiKeys, getSessions } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
|
|
||||||
const keys = await getApiKeys();
|
const keys = await getApiKeys();
|
||||||
const sessions = await getSessions();
|
const sessions = await getSessions();
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
|||||||
import { getAssetDuplicates } from '@immich/sdk';
|
import { getAssetDuplicates } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
const asset = await getAssetInfoFromParam(params);
|
const asset = await getAssetInfoFromParam(params);
|
||||||
const duplicates = await getAssetDuplicates();
|
const duplicates = await getAssetDuplicates();
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getAllJobsStatus } from '@immich/sdk';
|
import { getAllJobsStatus } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate({ admin: true });
|
await authenticate(url, { admin: true });
|
||||||
|
|
||||||
const jobs = await getAllJobsStatus();
|
const jobs = await getAllJobsStatus();
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { searchUsersAdmin } from '@immich/sdk';
|
import { searchUsersAdmin } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate({ admin: true });
|
await authenticate(url, { admin: true });
|
||||||
await requestServerInfo();
|
await requestServerInfo();
|
||||||
const allUsers = await searchUsersAdmin({ withDeleted: false });
|
const allUsers = await searchUsersAdmin({ withDeleted: false });
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getServerStatistics } from '@immich/sdk';
|
import { getServerStatistics } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate({ admin: true });
|
await authenticate(url, { admin: true });
|
||||||
const stats = await getServerStatistics();
|
const stats = await getServerStatistics();
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { getConfig } from '@immich/sdk';
|
import { getConfig } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate({ admin: true });
|
await authenticate(url, { admin: true });
|
||||||
const configs = await getConfig();
|
const configs = await getConfig();
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
|||||||
import { searchUsersAdmin } from '@immich/sdk';
|
import { searchUsersAdmin } from '@immich/sdk';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate({ admin: true });
|
await authenticate(url, { admin: true });
|
||||||
await requestServerInfo();
|
await requestServerInfo();
|
||||||
const allUsers = await searchUsersAdmin({ withDeleted: true });
|
const allUsers = await searchUsersAdmin({ withDeleted: true });
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
@ -5,8 +5,8 @@ import { getUserPreferencesAdmin, getUserStatisticsAdmin, searchUsersAdmin } fro
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params, url }) => {
|
||||||
await authenticate({ admin: true });
|
await authenticate(url, { admin: true });
|
||||||
await requestServerInfo();
|
await requestServerInfo();
|
||||||
const [user] = await searchUsersAdmin({ id: params.id, withDeleted: true }).catch(() => []);
|
const [user] = await searchUsersAdmin({ id: params.id, withDeleted: true }).catch(() => []);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
@ -6,8 +6,8 @@ import { redirect } from '@sveltejs/kit';
|
|||||||
import { get } from 'svelte/store';
|
import { get } from 'svelte/store';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate();
|
await authenticate(url);
|
||||||
if (!get(user).shouldChangePassword) {
|
if (!get(user).shouldChangePassword) {
|
||||||
redirect(302, AppRoute.PHOTOS);
|
redirect(302, AppRoute.PHOTOS);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
let oauthLoading = $state(true);
|
let oauthLoading = $state(true);
|
||||||
|
|
||||||
const onSuccess = async (user: LoginResponseDto) => {
|
const onSuccess = async (user: LoginResponseDto) => {
|
||||||
await goto(AppRoute.PHOTOS, { invalidateAll: true });
|
console.log(data.continueUrl);
|
||||||
|
await goto(data.continueUrl, { invalidateAll: true });
|
||||||
eventManager.emit('auth.login', user);
|
eventManager.emit('auth.login', user);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import { redirect } from '@sveltejs/kit';
|
|||||||
import { get } from 'svelte/store';
|
import { get } from 'svelte/store';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ parent }) => {
|
export const load = (async ({ parent, url }) => {
|
||||||
await parent();
|
await parent();
|
||||||
const { isInitialized } = get(serverConfig);
|
const { isInitialized } = get(serverConfig);
|
||||||
|
|
||||||
@ -20,5 +20,6 @@ export const load = (async ({ parent }) => {
|
|||||||
meta: {
|
meta: {
|
||||||
title: $t('login'),
|
title: $t('login'),
|
||||||
},
|
},
|
||||||
|
continueUrl: url.searchParams.get('continue') || AppRoute.PHOTOS,
|
||||||
};
|
};
|
||||||
}) satisfies PageLoad;
|
}) satisfies PageLoad;
|
||||||
|
@ -2,8 +2,8 @@ import { authenticate } from '$lib/utils/auth';
|
|||||||
import { getFormatter } from '$lib/utils/i18n';
|
import { getFormatter } from '$lib/utils/i18n';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate({ admin: true });
|
await authenticate(url, { admin: true });
|
||||||
|
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user