🏗️」 wip: tmp commit, will be overriden later, can be ignored

This commit is contained in:
yosyo
2025-09-27 15:50:09 +02:00
parent a93d295789
commit cb8823fcf3
5 changed files with 56 additions and 5 deletions

View File

@ -1,5 +1,6 @@
import fastifyJWT from '@fastify/jwt';
import fastifyCookie from '@fastify/cookie';
import cors from '@fastify/cors'
import { register } from './register.js';
import { login } from './login.js';
@ -22,6 +23,12 @@ authDB.prepareDB();
*/
export default async function(fastify, options) {
fastify.register(cors, {
origin: "http://localhost:5173",
credentials: true,
methods: [ "GET", "POST", "DELETE", "OPTIONS" ]
});
fastify.register(fastifyJWT, {
secret: process.env.JWT_SECRET || '123456789101112131415161718192021',
cookie: {