login okay
Some checks failed
Build Docker Image / run (push) Failing after 30s

This commit is contained in:
2024-04-26 16:00:53 +02:00
parent 06bdeff188
commit 02e84ed9d6
3 changed files with 35 additions and 27 deletions

View File

@ -1,16 +1,18 @@
---
import Layout from 'layouts/Layout.astro';
import { getUser } from 'libs/AuthUtils';
import Layout from 'layouts/Layout.astro'
import PocketBase from 'pocketbase'
const user = await getUser(Astro.cookies);
const pb = Astro.locals.pb as PocketBase
const auth = pb.authStore
const user = auth.model
if(!user){
if(!auth.isValid){
return Astro.redirect("/account/login");
}
---
<Layout title="Account setting">
<h1>Bonjour {user.name}</h1>
<h1>Bonjour {user!.name}</h1>
</Layout>