This commit is contained in:
2024-02-04 03:11:19 -07:00
parent b4a5fdebab
commit 1cfc6a9ae3
7 changed files with 186 additions and 106 deletions

View File

@@ -40,14 +40,15 @@ export const useAuthHeader = () => {
export const ClientProvider: React.FC<Props> = ({ children }) => {
const [authHeader, setAuthHeader] = useState({ key: "", value: "" });
console.log(`The api uri is ${API_URI}`);
const httpLink = new HttpLink({
uri: API_URI || "https://api-dev.railbird.ai/graphql",
uri: API_URI,
});
const cache = new InMemoryCache({});
const authMiddleware = new ApolloLink((operation, forward) => {
const { key, value } = authHeader;
console.log("Auth Key", key, "Value", value);
if (key && value) {
operation.setContext({
headers: {