feat: gestion-utilisateur #14

Closed
Clement wants to merge 38 commits from feat/gestion-utilisateur into master
50 changed files with 772 additions and 15976 deletions
Showing only changes of commit 4761fef61b - Show all commits

View File

@ -1,4 +1,22 @@
import { AstroCookies } from "astro";
import { PocketBase } from "PocketBase";
const pb = new PocketBase('https://pb-tweb.cb85.fr');
export async function getUser(cookies:AstroCookies): Promise<UserObj | null> {
const sessionID = cookies.get('session')?value
if(!sessionID){
return
}
const authData = await pb.collection('users').authRefresh();
console.log(pb.authStore.isValid);
console.log(pb.authStore.token);
console.log(pb.authStore.model.id);
}
//référence a loop //référence a loop
//fonction get user pour récupéré un utilisateur (notament coté client) //fonction get user pour récupéré un utilisateur (notament coté client)
//sessionID = JWS //sessionID = JWS