From a7c282ca348c1e8e60559e5c064caee28ba11eec Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Wed, 9 Oct 2024 16:34:12 +0300
Subject: refactor: so much shit

---
 frontend/src/api/Auth.tsx | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 frontend/src/api/Auth.tsx

(limited to 'frontend/src/api/Auth.tsx')

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 @@
+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"));
+};
-- 
cgit v1.2.3

