Compare commits

...

5 Commits

Author SHA1 Message Date
7a510a53a1 rm email visibility
All checks were successful
Build Docker Image / run (pull_request) Successful in 1m16s
Build Docker Image / run (push) Successful in 27s
2024-04-26 10:46:35 +02:00
063660db9d fix userObj type 2024-04-26 10:46:26 +02:00
55740b6219 fix error issue 2024-04-26 10:44:16 +02:00
459c1252e0 update package 2024-04-26 10:41:54 +02:00
cd234f5b37 rm usless thing 2024-04-26 10:41:37 +02:00
6 changed files with 62 additions and 724 deletions

746
front/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,6 @@
"type": "module",
"version": "0.0.1",
"private": "true",
"private": "true",
"scripts": {
"dev": "astro dev",
"start": "node ./dist/server/entry.mjs",
@ -28,10 +27,11 @@
"react-leaflet": "^4.2.1",
"simple-icons-astro": "^11.12.0",
"tailwindcss": "^3.4.3",
"typescript": "^5.2.2"
"typescript": "^5"
},
"devDependencies": {
"@astrojs/check": "^0",
"@astrojs/ts-plugin": "^1.6.1",
"@types/leaflet": "^1.9.12",
"@types/node": "^20",
"@typescript-eslint/eslint-plugin": "^6.21.0",

13
front/src/env.d.ts vendored
View File

@ -1,22 +1,11 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
export interface ImportMetaEnv {
NODE_ENV: string
APP_URL: string
POCKETBASEURL: string
POCKETBASE_URL: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
declare namespace App {
/**
* Middlewares variables
*/
interface Locals {}
}

View File

@ -4,7 +4,7 @@ import PocketBase from 'pocketbase'
import { getEnv } from 'libs/Env'
const pb = new PocketBase(getEnv('POCKET_BASE','https://pb-tweb.cb85.fr')) // XXX: 'https://pb-tweb.cb85.fr'
const pb = new PocketBase(getEnv('POCKETBASE_URL','https://pb-tweb.cb85.fr')) // XXX: 'https://pb-tweb.cb85.fr'
export async function clearUser(cookies: AstroCookies): Promise<void> {
const sessionID = cookies.get('session')?.value
@ -74,7 +74,7 @@ export async function getUser(cookies: AstroCookies): Promise<UserObj | null> {
emailVisibility: false,
name: bpAuth.model.name as string,
password: undefined,
passwordConfirm: undefined
passwordConfirm: undefined,
}
return output

View File

@ -1,19 +1,19 @@
export interface PBData{
id: string | null
collectionId: string | null
collectionName: string | null
created: string | null // TODO: passé ca en date auto
updated: string | null // TODO: passé ca en date auto
id?: string | null
collectionId?: string | null
collectionName?: string | null
created?: string | null // TODO: passé ca en date auto
updated?: string | null // TODO: passé ca en date auto
}
export default interface UserObj extends PBData{
avatar: string | null
avatar?: string | null
username: string
email: string
emailVisibility: false
password: string | undefined
passwordConfirm: string | undefined
emailVisibility?: boolean
password?: string | undefined
passwordConfirm?: string | undefined
name: string | null
}

View File

@ -23,7 +23,6 @@ const res = await AstroUtils.wrap(async () => {
email: form.get("email") as string,
password: form.get("password") as string,
passwordConfirm: form.get("passwordConfirm") as string,
emailVisibility: false
}
await setUser(Astro.cookies, request);