All checks were successful
Build and Push Image / docker-build-and-push (push) Successful in 2m20s
Co-authored-by: Shaun Campbell <shaun@campbellwireless.net> Reviewed-on: #37 Co-authored-by: AI Agent <ai-agent@campbellwireless.net> Co-committed-by: AI Agent <ai-agent@campbellwireless.net>
21 lines
675 B
TypeScript
21 lines
675 B
TypeScript
import { env } from '$env/dynamic/private';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
const resolveErrorMessage = (value: string | null): string | null => {
|
|
if (!value) return null;
|
|
if (value === 'CredentialsSignin') return 'Invalid credentials';
|
|
return null;
|
|
};
|
|
|
|
export const load: PageServerLoad = async ({ url }) => {
|
|
const authUrl = process.env.AUTH_URL ?? env.AUTH_URL ?? '';
|
|
const localAuthEnabled = (process.env.LOCAL_AUTH_ENABLED ?? env.LOCAL_AUTH_ENABLED) === 'true';
|
|
|
|
return {
|
|
signinUrl: `${authUrl}/signin/synology`,
|
|
localSigninUrl: `${authUrl}/signin/local`,
|
|
localAuthEnabled,
|
|
error: resolveErrorMessage(url.searchParams.get('error'))
|
|
};
|
|
};
|