mirror of
https://github.com/1f349/admin.1f349.com.git
synced 2025-02-22 05:24:57 +00:00
Fix jwt parsing
This commit is contained in:
parent
075f21a9a3
commit
70c0fbd772
@ -33,7 +33,7 @@ export function getBearer() {
|
||||
|
||||
export function parseJwt(token: string) {
|
||||
const tokenParts = token.split(".");
|
||||
if(tokenParts.length !== 2) return null;
|
||||
if(tokenParts.length !== 3) return null;
|
||||
const base64Url = tokenParts[1];
|
||||
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
||||
const jsonPayload = decodeURIComponent(
|
||||
|
Loading…
x
Reference in New Issue
Block a user