feat(web): continue after login (#18302)
This commit is contained in:
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAllAlbums } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate(url);
|
||||
const sharedAlbums = await getAllAlbums({ shared: true });
|
||||
const albums = await getAllAlbums({});
|
||||
const $t = await getFormatter();
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getAlbumInfo } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const [album, asset] = await Promise.all([
|
||||
getAlbumInfo({ id: params.albumId, withoutAssets: true }),
|
||||
getAssetInfoFromParam(params),
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { activateProduct, getActivationKey } from '$lib/utils/license-utils';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate();
|
||||
await authenticate(url);
|
||||
|
||||
const $t = await getFormatter();
|
||||
const licenseKey = url.searchParams.get('licenseKey');
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAllPeople, getExploreData } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate(url);
|
||||
const [items, response] = await Promise.all([getExploreData(), getAllPeople({ withHidden: false })]);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { buildTree, normalizeTreePath } from '$lib/utils/tree-utils';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate();
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
const user = await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
const user = await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getUser } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
|
||||
const partner = await getUser({ id: params.userId });
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAllPeople } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate(url);
|
||||
|
||||
const people = await getAllPeople({ withHidden: true });
|
||||
const $t = await getFormatter();
|
||||
|
||||
@@ -4,8 +4,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getPerson, getPersonStatistics } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
|
||||
const [person, statistics, asset] = await Promise.all([
|
||||
getPerson({ id: params.personId }),
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetsByCity } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate(url);
|
||||
const items = await getAssetsByCity();
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getMySharedLink, isHttpError } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
export const load = (async ({ params, url }) => {
|
||||
const { key } = params;
|
||||
await authenticate({ public: true });
|
||||
await authenticate(url, { public: true });
|
||||
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { authenticate } from '$lib/utils/auth';
|
||||
import { getFormatter } from '$lib/utils/i18n';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate(url);
|
||||
const $t = await getFormatter();
|
||||
|
||||
return {
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { PartnerDirection, getAllAlbums, getPartners } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate(url);
|
||||
const sharedAlbums = await getAllAlbums({ shared: true });
|
||||
const partners = await getPartners({ direction: PartnerDirection.SharedWith });
|
||||
const $t = await getFormatter();
|
||||
|
||||
@@ -7,7 +7,7 @@ import { getAllTags } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate();
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getApiKeys, getSessions } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
export const load = (async ({ url }) => {
|
||||
await authenticate(url);
|
||||
|
||||
const keys = await getApiKeys();
|
||||
const sessions = await getSessions();
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getFormatter } from '$lib/utils/i18n';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = await getFormatter();
|
||||
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getAssetDuplicates } from '@immich/sdk';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
await authenticate();
|
||||
export const load = (async ({ params, url }) => {
|
||||
await authenticate(url);
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const duplicates = await getAssetDuplicates();
|
||||
const $t = await getFormatter();
|
||||
|
||||
Reference in New Issue
Block a user