refactor: enforce setAuthToken to strictly require a token, add /notes to gitignore, and include logo asset.

This commit is contained in:
2025-11-24 21:25:45 +01:00
parent 8c16730d31
commit deec2fe69d
2 changed files with 3 additions and 7 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ type HttpClient = typeof httpClient;
interface ApiContextValue {
client: HttpClient;
setAuthToken: (token?: string | null) => void;
setAuthToken: (token: string) => void;
clearAuthToken: () => void;
}
+2 -6
View File
@@ -281,12 +281,8 @@ export const listTenants = async (): Promise<TenantSnippet[]> => {
return Array.isArray(data?.tenants) ? data.tenants : [];
};
export const setAuthToken = (token?: string | null) => {
if (token) {
api.defaults.headers.common.Authorization = `Bearer ${token}`;
} else {
delete api.defaults.headers.common.Authorization;
}
export const setAuthToken = (token: string) => {
api.defaults.headers.common.Authorization = `Bearer ${token}`;
};
export const clearAuthToken = () => {