fix test errors

This commit is contained in:
2026-04-15 11:05:50 +08:00
parent 4809ad03e4
commit 51f0315d68
9 changed files with 402 additions and 45 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ export function decodeJwtPayload(token: string): Record<string, unknown> | null
try {
const parts = token.split('.')
if (parts.length !== 3) return null
const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/')
const base64 = parts[1]!.replace(/-/g, '+').replace(/_/g, '/')
const padded = base64 + '='.repeat((4 - base64.length % 4) % 4)
const decoded = atob(padded)
return JSON.parse(decoded)