aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/api/Auth.tsx
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2024-10-09 16:34:12 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2024-10-09 16:34:12 +0300
commita7c282ca348c1e8e60559e5c064caee28ba11eec (patch)
tree43bd7bdb2bbc80b92b96a14b36c33f0b7df622c9 /frontend/src/api/Auth.tsx
parentRankings page (diff)
downloadlphub-a7c282ca348c1e8e60559e5c064caee28ba11eec.tar.gz
lphub-a7c282ca348c1e8e60559e5c064caee28ba11eec.tar.bz2
lphub-a7c282ca348c1e8e60559e5c064caee28ba11eec.zip
refactor: so much shit
Diffstat (limited to 'frontend/src/api/Auth.tsx')
-rw-r--r--frontend/src/api/Auth.tsx14
1 files changed, 14 insertions, 0 deletions
diff --git a/frontend/src/api/Auth.tsx b/frontend/src/api/Auth.tsx
new file mode 100644
index 0000000..09269e6
--- /dev/null
+++ b/frontend/src/api/Auth.tsx
@@ -0,0 +1,14 @@
1import axios from "axios";
2import { url } from "./Api";
3
4export const get_token = async (): Promise<string | undefined> => {
5 const response = await axios.get(url(`token`))
6 if (!response.data.success) {
7 return undefined;
8 }
9 return response.data.data.token;
10};
11
12export const delete_token = async () => {
13 await axios.delete(url("token"));
14};