Add API_BASE to DiscordActivityContext.tsx
cgen-976eb5b1c3764e02ae10f7eff0d921e2
This commit is contained in:
parent
9aa32cac83
commit
da3a8c7c8e
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import React, { createContext, useContext, useEffect, useState } from "react";
|
||||
|
||||
const API_BASE = (globalThis as any).import?.meta?.env?.VITE_API_BASE || "";
|
||||
|
||||
interface DiscordUser {
|
||||
id: string;
|
||||
discord_id: string;
|
||||
|
|
@ -134,7 +136,7 @@ export const DiscordActivityProvider: React.FC<
|
|||
);
|
||||
|
||||
// Exchange code for access token via our backend
|
||||
const tokenResponse = await fetch("/api/discord/token", {
|
||||
const tokenResponse = await fetch(`${API_BASE}/api/discord/token`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
|||
Loading…
Reference in a new issue