feat: work
This commit is contained in:
parent
4f1a2ce105
commit
3b8d3aa7f9
|
@ -1,6 +1,6 @@
|
||||||
const DiscordApi = {
|
const DiscordApi = {
|
||||||
getUser: async () => {
|
getUser: async () => {
|
||||||
if (typeof localStorage.getItem('token') === undefined)
|
if (typeof localStorage.getItem('token') !== "string")
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
const req = await fetch('https://discord.com/api/v10/users/@me', {
|
const req = await fetch('https://discord.com/api/v10/users/@me', {
|
||||||
|
@ -14,7 +14,7 @@ const DiscordApi = {
|
||||||
return await req.json();
|
return await req.json();
|
||||||
},
|
},
|
||||||
refreshToken: () => {
|
refreshToken: () => {
|
||||||
if (typeof localStorage.getItem('refresh') === undefined)
|
if (typeof localStorage.getItem('refresh') !== "string")
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
fetch('https://crss-api.theclashfruit.workers.dev/refresh', {
|
fetch('https://crss-api.theclashfruit.workers.dev/refresh', {
|
||||||
|
|
Loading…
Reference in a new issue