initial OIDC setup

This commit is contained in:
2024-02-14 16:07:55 +01:00
parent 1929189187
commit a781be8d00
28 changed files with 226 additions and 373 deletions

View File

@@ -1,5 +1,8 @@
import { get_username } from '$lib/js/get_username';;
import type { Actions, PageServerLoad } from "./$types"
import { error } from "@sveltejs/kit"
export const load = (async ({cookies}) => {
return { user: await get_username(cookies) }
export const load = (async ({cookies, locals}) => {
return {
session: await locals.getSession()
}
});

View File

@@ -3,8 +3,8 @@ 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
if(data.session){
username = data.session.user.name
}
</script>