Minor fixes

This commit is contained in:
WardPearce
2026-02-14 17:29:43 +13:00
parent 49b9c8fff0
commit 25ea717bd4
2 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import { sign } from 'cookie-signature';
import { env } from '$env/dynamic/private';
export function setAuthCookie(id: string, cookies: Cookies) {
cookies.set('userid', sign(id, env.COOKIE_SECRET), {
cookies.set('userid', sign(id, env.COOKIE_SECRET as string), {
httpOnly: true,
path: '/api',
maxAge: 60 * 60 * 24 * 60 // 60 days
+16 -16
View File
@@ -61,25 +61,25 @@ export async function load({ url }) {
}
}
const defaultPage = get(interfaceDefaultPage);
if (
defaultPage &&
defaultPage !== '/' &&
defaultPage.startsWith('/') &&
url.pathname === resolvedRoot &&
window.history.length < 3
) {
getPages().forEach((page) => {
if (page.href === defaultPage && (!page.requiresAuth || get(authStore))) {
goto(resolve(defaultPage, {}));
}
});
}
const isLoginPage = url.pathname.endsWith('/internal/login');
if (!isLoginPage) {
const defaultPage = get(interfaceDefaultPage);
if (
defaultPage &&
defaultPage !== '/' &&
defaultPage.startsWith('/') &&
url.pathname === resolvedRoot &&
window.history.length < 3
) {
getPages().forEach((page) => {
if (page.href === defaultPage && (!page.requiresAuth || get(authStore))) {
goto(resolve(defaultPage, {}));
}
});
}
if (isOwnBackend()?.requireAuth && !get(rawMasterKeyStore)) {
goto(resolve('/internal/login', {}), { replaceState: true });
} else if (!get(instanceStore) && !isYTBackend() && !url.pathname.endsWith('/setup')) {