aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/api/Auth.tsx
blob: 09269e649b7a252d09dd641b3a773898cc30add9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import axios from "axios";
import { url } from "./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"));
};