---
import Layout from 'layouts/Layout.astro'
import PocketBase from 'pocketbase'


const pb = Astro.locals.pb
const auth = pb.authStore
const user = auth.model

if(!auth.isValid){
    return Astro.redirect("/account/login");
}

---

<Layout title="Account setting">
    <h1>Bonjour {user!.username}</h1>
    <div>
        <a href="/account/logout">deconnexion</a>
    </div>
</Layout>
