wip: token passed to headers, need to make hook for onAuthStateChanged

This commit is contained in:
Loewy
2024-02-05 23:58:39 -08:00
11 changed files with 107 additions and 45 deletions

View File

@@ -6,7 +6,7 @@ import {
InMemoryCache,
from,
} from "@apollo/client";
import { API_URI } from "@env";
import React, {
ReactNode,
createContext,
@@ -15,17 +15,19 @@ import React, {
useState,
} from "react";
import { API_URI } from '../config'
type Props = {
children: ReactNode;
};
export const AuthHeaderContext = createContext<
| {
authHeader: { key: string; value: string };
setAuthHeader: React.Dispatch<
React.SetStateAction<{ key: string; value: string }>
>;
}
authHeader: { key: string; value: string };
setAuthHeader: React.Dispatch<
React.SetStateAction<{ key: string; value: string }>
>;
}
| undefined
>(undefined);