From cf88b08ac6a6143decac17e0c1412936ce27d250 Mon Sep 17 00:00:00 2001 From: AlexBocken Date: Tue, 18 Jul 2023 14:28:39 +0200 Subject: [PATCH] allow for build because of jsonwebtoken quirk --- src/lib/js/authenticate.ts | 3 ++- src/routes/api/login/+server.ts | 3 ++- src/routes/api/verify/+server.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/js/authenticate.ts b/src/lib/js/authenticate.ts index f163ce5..2e25dc6 100644 --- a/src/lib/js/authenticate.ts +++ b/src/lib/js/authenticate.ts @@ -1,6 +1,7 @@ import type { RequestEvent } from "@sveltejs/kit"; import { COOKIE_SECRET } from "$env/static/private"; -import { verify } from "jsonwebtoken"; +import pkg from 'jsonwebtoken'; +const { verify } = pkg; import { error } from "@sveltejs/kit"; import { dbConnect, dbDisconnect } from "../../utils/db"; import { User } from "../../models/User";; diff --git a/src/routes/api/login/+server.ts b/src/routes/api/login/+server.ts index 05754ad..656e5a5 100644 --- a/src/routes/api/login/+server.ts +++ b/src/routes/api/login/+server.ts @@ -1,6 +1,7 @@ import type { RequestHandler } from '@sveltejs/kit'; import { error } from '@sveltejs/kit'; -import { sign } from 'jsonwebtoken'; +import pkg from 'jsonwebtoken'; +const { sign } = pkg; import { verify} from 'argon2'; import { COOKIE_SECRET } from '$env/static/private' import { PEPPER } from '$env/static/private' diff --git a/src/routes/api/verify/+server.ts b/src/routes/api/verify/+server.ts index 50d3aa1..ad41d82 100644 --- a/src/routes/api/verify/+server.ts +++ b/src/routes/api/verify/+server.ts @@ -1,6 +1,7 @@ import type { RequestHandler } from '@sveltejs/kit'; import { error } from '@sveltejs/kit'; -import { verify } from 'jsonwebtoken'; +import pkg from 'jsonwebtoken'; +const { verify } = pkg; import { hash} from 'argon2'; import { randomBytes } from 'crypto'; import { COOKIE_SECRET } from '$env/static/private'