some module updates

This commit is contained in:
titver968
2025-02-14 11:49:17 +01:00
parent eed7ddeb92
commit a7005b230f
8 changed files with 2298 additions and 33 deletions

View File

@@ -1,10 +1,13 @@
import { json } from "@sveltejs/kit";
import jwt from "jsonwebtoken";
import { json } from '@sveltejs/kit';
import jwt from 'jsonwebtoken';
export async function POST() {
const token = await jwt.sign({
id: 'sample-id',
secret: 'secret'
},"shhhhh");
const token = await jwt.sign(
{
id: 'sample-id',
secret: 'secret'
},
'shhhhh'
);
return json({ token });
}

View File

@@ -1,8 +1,9 @@
import { error } from "@sveltejs/kit";
import { json } from "@sveltejs/kit";
import { error } from '@sveltejs/kit';
import { json } from '@sveltejs/kit';
//
// import { verify } from 'jsonwebtoken';
import jwt from 'jsonwebtoken'; const { sign, verify } = jwt;
import jwt from 'jsonwebtoken';
const { sign, verify } = jwt;
export function GET({ request }) {
const authorization = request.headers.get('authorization');