aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/api/Auth.ts
blob: 875c7e5d71a8906c6d9be6abf764b73306cda7d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import axios from "axios";
import { url } from "@api/Api";

export const get_token = async (): Promise<string | undefined> => {
  const response = await axios.get(url(`token`))
  if (!response.data.success) {
    return undefined;
  }
  return response.data.data.token;
};

export const delete_token = async () => {
  await axios.delete(url("token"));
};