refactor: redirect code (#25054)

This commit is contained in:
Jason Rasmussen
2026-01-05 14:39:28 -05:00
committed by GitHub
parent 10989e6927
commit 4d32968f2b
13 changed files with 23 additions and 23 deletions
@@ -10,7 +10,7 @@ export const load = (async ({ url }) => {
const { isElevated, pinCode } = await getAuthStatus();
if (!isElevated || !pinCode) {
redirect(302, `${AppRoute.AUTH_PIN_PROMPT}?continue=${encodeURIComponent(url.pathname + url.search)}`);
redirect(307, `${AppRoute.AUTH_PIN_PROMPT}?continue=${encodeURIComponent(url.pathname + url.search)}`);
}
const $t = await getFormatter();
@@ -9,12 +9,12 @@ export const load = (async ({ params, url }) => {
await authenticate(url);
if (!UUID_REGEX.test(params.id)) {
redirect(302, AppRoute.SHARED_LINKS);
redirect(307, AppRoute.SHARED_LINKS);
}
const [sharedLink] = await getAllSharedLinks({ id: params.id });
if (!sharedLink) {
redirect(302, AppRoute.SHARED_LINKS);
redirect(307, AppRoute.SHARED_LINKS);
}
const $t = await getFormatter();
@@ -4,5 +4,5 @@ import type { PageLoad } from './$types';
export const load = (({ params }) => {
const photoId = params.photoId;
return redirect(302, `${AppRoute.PHOTOS}/${photoId}`);
return redirect(307, `${AppRoute.PHOTOS}/${photoId}`);
}) satisfies PageLoad;