From 271e0efce120d530242e33fb16d2ac0f88dc6088 Mon Sep 17 00:00:00 2001 From: Chris Griffing Date: Sat, 26 Oct 2024 17:31:57 -0700 Subject: [PATCH] fix: scrub quotes from token signing key --- playgrounds/app/src/db/client.ts | 1 - playgrounds/app/src/lib/jwt.ts | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/playgrounds/app/src/db/client.ts b/playgrounds/app/src/db/client.ts index ebc466e..656d4b3 100644 --- a/playgrounds/app/src/db/client.ts +++ b/playgrounds/app/src/db/client.ts @@ -2,7 +2,6 @@ import 'dotenv/config' import { drizzle } from 'drizzle-orm/libsql' import { schema } from './schema' -console.log('Token: ', process.env.TURSO_AUTH_TOKEN?.substring(0, 10)) export const db = drizzle({ schema: schema, connection: { diff --git a/playgrounds/app/src/lib/jwt.ts b/playgrounds/app/src/lib/jwt.ts index 5d5aea6..9ebdbc5 100644 --- a/playgrounds/app/src/lib/jwt.ts +++ b/playgrounds/app/src/lib/jwt.ts @@ -1,9 +1,7 @@ import 'dotenv/config' import jwt from 'jsonwebtoken' -const TOKEN_SIGNING_KEY = process.env.TOKEN_SIGNING_KEY! - -console.log('Has quotes', TOKEN_SIGNING_KEY?.match(/"/g)?.length) +const TOKEN_SIGNING_KEY = process.env.TOKEN_SIGNING_KEY!.replace(/"/g, '') export function decodeToken(token: string) { return jwt.verify(token, TOKEN_SIGNING_KEY, {