Compare commits
5 Commits
76755baa1d
...
7a510a53a1
Author | SHA1 | Date | |
---|---|---|---|
7a510a53a1 | |||
063660db9d | |||
55740b6219 | |||
459c1252e0 | |||
cd234f5b37 |
746
front/package-lock.json
generated
746
front/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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
13
front/src/env.d.ts
vendored
@ -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 {}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user