fix test errors
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user