Skip to content

Commit

Permalink
fix: scrub quotes from token signing key
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgriffing committed Oct 27, 2024
1 parent a6a27dc commit 271e0ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion playgrounds/app/src/db/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 1 addition & 3 deletions playgrounds/app/src/lib/jwt.ts
Original file line number Diff line number Diff line change
@@ -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, {
Expand Down

0 comments on commit 271e0ef

Please sign in to comment.