First working version of EVE-PI

This commit is contained in:
Calli
2023-06-23 12:07:45 +03:00
commit 5429ff7969
46 changed files with 28631 additions and 0 deletions

13
src/utils.ts Normal file
View File

@@ -0,0 +1,13 @@
import { AccessToken, Character } from "./types";
export const extractCharacterFromToken = (token: AccessToken): Character => {
const decodedToken = parseJwt(token.access_token);
return {
name: decodedToken.name,
characterId: decodedToken.sub.split(":")[2],
};
};
const parseJwt = (token: string) => {
return JSON.parse(Buffer.from(token.split(".")[1], "base64").toString());
};