summaryrefslogtreecommitdiff
path: root/together/src/utils/InternalAPI.ts
blob: b64f576b4d549b267a9376dbdc91831926b990a1 (plain)
1
2
3
4
5
6
7
8
9
10
import superagent from "superagent";

export async function isSessionValid(token: string): Promise<boolean> {
    let res = await superagent.get("https://peh-internal.minteck.org/api/session")
        .set("Cookie", "PEH2_SESSION_TOKEN=" + token)
        .send();

    if (res.text === "VALID") return true;
    return false;
}