mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
15 lines
373 B
TypeScript
15 lines
373 B
TypeScript
import { JSONObject } from "../../Types/JSON";
|
|
import JSONFunctions from "../../Types/JSONFunctions";
|
|
|
|
export default class JsonWebToken {
|
|
public static decode(token: string): JSONObject | null {
|
|
if (token && token.includes(".")) {
|
|
return JSONFunctions.parseJSONObject(
|
|
window.atob(token.split(".")[1] as string),
|
|
);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|