diff --git a/sveltekit/github-oauth/src/routes/login/+page.server.ts b/sveltekit/github-oauth/src/routes/login/+page.server.ts index dffb4b4..3bc4d86 100644 --- a/sveltekit/github-oauth/src/routes/login/+page.server.ts +++ b/sveltekit/github-oauth/src/routes/login/+page.server.ts @@ -1,6 +1,7 @@ import { redirect } from '@sveltejs/kit'; +import type { PageServerLoad } from './$types'; -export const load = async ({ locals }) => { +export const load: PageServerLoad = async ({ locals }) => { const session = await locals.auth.validate(); if (session) throw redirect(302, '/'); return {}; diff --git a/sveltekit/github-oauth/src/routes/login/github/+server.ts b/sveltekit/github-oauth/src/routes/login/github/+server.ts index 1d153d5..1446903 100644 --- a/sveltekit/github-oauth/src/routes/login/github/+server.ts +++ b/sveltekit/github-oauth/src/routes/login/github/+server.ts @@ -1,7 +1,8 @@ import { dev } from '$app/environment'; import { githubAuth } from '$lib/server/lucia.js'; +import type { RequestHandler } from './$types'; -export const GET = async ({ cookies, locals }) => { +export const GET : RequestHandler = async ({ cookies, locals }) => { const session = await locals.auth.validate(); if (session) { return new Response(null, { diff --git a/sveltekit/github-oauth/src/routes/login/github/callback/+server.ts b/sveltekit/github-oauth/src/routes/login/github/callback/+server.ts index 80a20a2..9813ed0 100644 --- a/sveltekit/github-oauth/src/routes/login/github/callback/+server.ts +++ b/sveltekit/github-oauth/src/routes/login/github/callback/+server.ts @@ -1,7 +1,8 @@ import { auth, githubAuth } from '$lib/server/lucia.js'; import { OAuthRequestError } from '@lucia-auth/oauth'; +import type { RequestHandler } from '../$types'; -export const GET = async ({ url, cookies, locals }) => { +export const GET: RequestHandler = async ({ url, cookies, locals }) => { const session = await locals.auth.validate(); if (session) { return new Response(null, {