chat-ui / src /routes /login /+page.server.ts
Adrien Denat
Login flow (#193)
64d3841 unverified
raw
history blame
No virus
432 Bytes
import { redirect } from "@sveltejs/kit";
import { getOIDCAuthorizationUrl, getRedirectURI } from "$lib/server/auth";
export const actions = {
default: async function ({ url, locals }) {
// TODO: Handle errors if provider is not responding
const authorizationUrl = await getOIDCAuthorizationUrl(
{ redirectURI: getRedirectURI(url) },
{ sessionId: locals.sessionId }
);
throw redirect(303, authorizationUrl);
},
};