mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-10-14 02:54:44 +02:00
「🔨」 fix(cors issue): should be working as expected
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@avalabs/avalanchejs": "^5.0.0",
|
"@avalabs/avalanchejs": "^5.0.0",
|
||||||
"@fastify/cookie": "^11.0.2",
|
"@fastify/cookie": "^11.0.2",
|
||||||
|
"@fastify/cors": "^11.1.0",
|
||||||
"@fastify/env": "^5.0.2",
|
"@fastify/env": "^5.0.2",
|
||||||
"@fastify/jwt": "^9.1.0",
|
"@fastify/jwt": "^9.1.0",
|
||||||
"axios": "^1.10.0",
|
"axios": "^1.10.0",
|
||||||
|
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
@ -14,6 +14,9 @@ importers:
|
|||||||
'@fastify/cookie':
|
'@fastify/cookie':
|
||||||
specifier: ^11.0.2
|
specifier: ^11.0.2
|
||||||
version: 11.0.2
|
version: 11.0.2
|
||||||
|
'@fastify/cors':
|
||||||
|
specifier: ^11.1.0
|
||||||
|
version: 11.1.0
|
||||||
'@fastify/env':
|
'@fastify/env':
|
||||||
specifier: ^5.0.2
|
specifier: ^5.0.2
|
||||||
version: 5.0.2
|
version: 5.0.2
|
||||||
@ -255,6 +258,9 @@ packages:
|
|||||||
'@fastify/cookie@11.0.2':
|
'@fastify/cookie@11.0.2':
|
||||||
resolution: {integrity: sha512-GWdwdGlgJxyvNv+QcKiGNevSspMQXncjMZ1J8IvuDQk0jvkzgWWZFNC2En3s+nHndZBGV8IbLwOI/sxCZw/mzA==}
|
resolution: {integrity: sha512-GWdwdGlgJxyvNv+QcKiGNevSspMQXncjMZ1J8IvuDQk0jvkzgWWZFNC2En3s+nHndZBGV8IbLwOI/sxCZw/mzA==}
|
||||||
|
|
||||||
|
'@fastify/cors@11.1.0':
|
||||||
|
resolution: {integrity: sha512-sUw8ed8wP2SouWZTIbA7V2OQtMNpLj2W6qJOYhNdcmINTu6gsxVYXjQiM9mdi8UUDlcoDDJ/W2syPo1WB2QjYA==}
|
||||||
|
|
||||||
'@fastify/deepmerge@2.0.2':
|
'@fastify/deepmerge@2.0.2':
|
||||||
resolution: {integrity: sha512-3wuLdX5iiiYeZWP6bQrjqhrcvBIf0NHbQH1Ur1WbHvoiuTYUEItgygea3zs8aHpiitn0lOB8gX20u1qO+FDm7Q==}
|
resolution: {integrity: sha512-3wuLdX5iiiYeZWP6bQrjqhrcvBIf0NHbQH1Ur1WbHvoiuTYUEItgygea3zs8aHpiitn0lOB8gX20u1qO+FDm7Q==}
|
||||||
|
|
||||||
@ -1758,6 +1764,11 @@ snapshots:
|
|||||||
cookie: 1.0.2
|
cookie: 1.0.2
|
||||||
fastify-plugin: 5.0.1
|
fastify-plugin: 5.0.1
|
||||||
|
|
||||||
|
'@fastify/cors@11.1.0':
|
||||||
|
dependencies:
|
||||||
|
fastify-plugin: 5.0.1
|
||||||
|
toad-cache: 3.7.0
|
||||||
|
|
||||||
'@fastify/deepmerge@2.0.2': {}
|
'@fastify/deepmerge@2.0.2': {}
|
||||||
|
|
||||||
'@fastify/env@5.0.2':
|
'@fastify/env@5.0.2':
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import fastifyJWT from '@fastify/jwt';
|
import fastifyJWT from '@fastify/jwt';
|
||||||
import fastifyCookie from '@fastify/cookie';
|
import fastifyCookie from '@fastify/cookie';
|
||||||
|
import cors from '@fastify/cors'
|
||||||
|
|
||||||
import { register } from './register.js';
|
import { register } from './register.js';
|
||||||
import { login } from './login.js';
|
import { login } from './login.js';
|
||||||
@ -22,6 +23,11 @@ authDB.prepareDB();
|
|||||||
*/
|
*/
|
||||||
export default async function(fastify, options) {
|
export default async function(fastify, options) {
|
||||||
|
|
||||||
|
fastify.register(cors, {
|
||||||
|
origin: "*",
|
||||||
|
methods: ["GET", "POST", "DELETE"]
|
||||||
|
});
|
||||||
|
|
||||||
fastify.register(fastifyJWT, {
|
fastify.register(fastifyJWT, {
|
||||||
secret: process.env.JWT_SECRET || '123456789101112131415161718192021',
|
secret: process.env.JWT_SECRET || '123456789101112131415161718192021',
|
||||||
cookie: {
|
cookie: {
|
||||||
|
Reference in New Issue
Block a user