feat: work

This commit is contained in:
TheClashFruit 2023-08-24 16:40:40 +02:00
parent 4f1a2ce105
commit 3b8d3aa7f9
Signed by: TheClashFruit
GPG key ID: CF4A319B9A73290C

View file

@ -1,6 +1,6 @@
const DiscordApi = {
getUser: async () => {
if (typeof localStorage.getItem('token') === undefined)
if (typeof localStorage.getItem('token') !== "string")
return null;
const req = await fetch('https://discord.com/api/v10/users/@me', {
@ -14,7 +14,7 @@ const DiscordApi = {
return await req.json();
},
refreshToken: () => {
if (typeof localStorage.getItem('refresh') === undefined)
if (typeof localStorage.getItem('refresh') !== "string")
return null;
fetch('https://crss-api.theclashfruit.workers.dev/refresh', {