mirror of
https://github.com/1f349/admin.1f349.com.git
synced 2024-11-09 22:32: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) {
|
export function parseJwt(token: string) {
|
||||||
const tokenParts = token.split(".");
|
const tokenParts = token.split(".");
|
||||||
if(tokenParts.length !== 2) return null;
|
if(tokenParts.length !== 3) return null;
|
||||||
const base64Url = tokenParts[1];
|
const base64Url = tokenParts[1];
|
||||||
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
||||||
const jsonPayload = decodeURIComponent(
|
const jsonPayload = decodeURIComponent(
|
||||||
|
Loading…
Reference in New Issue
Block a user