We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e832031 commit 50c681eCopy full SHA for 50c681e
1 file changed
frontend/app/context/Auth.tsx
@@ -7,7 +7,7 @@ type User = { email: string } | null;
7
type AuthCtx = {
8
user: User;
9
token: string | null;
10
- authHeader: () => Record<string, string>;
+ authHeader: () => Partial<Record<string, string>>;
11
};
12
13
const AuthContext = createContext<AuthCtx | null>(null);
@@ -18,7 +18,8 @@ export function AuthProvider({ children }: { children: ReactNode }) {
18
const [token, setToken] = useState<string | null>(null);
19
const [user, setUser] = useState<User>(null);
20
21
- const authHeader = () => (token ? { Authorization: `Bearer ${token}` } : {});
+ const authHeader = () =>
22
+ token ? { Authorization: `Bearer ${token}` } : {};
23
24
return (
25
<AuthContext.Provider value={{ user, token, authHeader }}>
0 commit comments