mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
fix: userInfo name conversion encoding format (#755)
This commit is contained in:
@@ -100,17 +100,13 @@ class Token {
|
|||||||
static parse(token: string): AccessTokenMessage | null {
|
static parse(token: string): AccessTokenMessage | null {
|
||||||
try {
|
try {
|
||||||
return JSON.parse(
|
return JSON.parse(
|
||||||
String.fromCharCode.apply(
|
decodeURIComponent(
|
||||||
null,
|
atob(token.split('.')[1])
|
||||||
Array.from(
|
.split('')
|
||||||
Uint8Array.from(
|
.map(function (c) {
|
||||||
window.atob(
|
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
||||||
// split jwt
|
})
|
||||||
token.split('.')[1]
|
.join('')
|
||||||
),
|
|
||||||
c => c.charCodeAt(0)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user