Update @auth/sveltekit to latest stable version 1.10.0

- Upgraded @auth/sveltekit from 0.14.0 to 1.10.0
- Updated session API from event.locals.getSession() to event.locals.auth()
- Fixed TypeScript definitions for new auth API in app.d.ts
- Updated layout server load functions to use LayoutServerLoad type
- Fixed session callbacks with proper token type casting
- Switched to generic OIDC provider config to resolve issuer validation issues
- All auth functionality now working with latest Auth.js version

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-31 21:45:14 +02:00
parent 36bdb0d65c
commit 74dd2b1f4b
12 changed files with 156 additions and 91 deletions

View File

@@ -1,6 +1,6 @@
import type { PageServerLoad } from "./$types"
import type { LayoutServerLoad } from "./$types"
export const load : PageServerLoad = (async ({locals}) => {
export const load : LayoutServerLoad = (async ({locals}) => {
return {
session: await locals.auth(),
}

View File

@@ -1,6 +1,6 @@
import type { PageServerLoad } from "./$types"
import type { LayoutServerLoad } from "./$types"
export const load : PageServerLoad = (async ({locals}) => {
export const load : LayoutServerLoad = (async ({locals}) => {
return {
session: await locals.auth(),
}

View File

@@ -2,10 +2,6 @@
import Header from '$lib/components/Header.svelte'
import UserHeader from '$lib/components/UserHeader.svelte';
export let data
let username = ""
if(data.user){
username = data.user.username
}
</script>
<Header>
<ul class=site_header slot=links>
@@ -13,6 +9,6 @@ if(data.user){
<li><a href="/glaube/rosenkranz">Rosenkranz</a></li>
<li><a href="/glaube/predigten">Predigten</a></li>
</ul>
<UserHeader {username} slot=right_side></UserHeader>
<UserHeader user={data.session?.user} slot=right_side></UserHeader>
<slot></slot>
</Header>

View File

@@ -1,6 +1,6 @@
import type { PageServerLoad } from "./$types"
import type { LayoutServerLoad } from "./$types"
export const load : PageServerLoad = async ({locals}) => {
export const load : LayoutServerLoad = async ({locals}) => {
return {
session: await locals.auth()
}

View File

@@ -1,5 +1,6 @@
export async function load({locals}) {
const session = await locals.auth();
return {
user: locals.user
user: session?.user
};
};

View File

@@ -1,10 +1,11 @@
import type { PageLoad } from "./$types";
import type { PageServerLoad } from "./$types";
export async function load({ fetch, params, locals}) {
let current_month = new Date().getMonth() + 1
const res = await fetch(`/api/rezepte/items/${params.name}`);
const recipe = await res.json();
const session = await locals.auth();
return {recipe: recipe,
user: locals.user
user: session?.user
};
};