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 { interface ApiContextValue {
client: HttpClient; client: HttpClient;
setAuthToken: (token?: string | null) => void; setAuthToken: (token: string) => void;
clearAuthToken: () => void; clearAuthToken: () => void;
} }
+1 -5
View File
@@ -281,12 +281,8 @@ export const listTenants = async (): Promise<TenantSnippet[]> => {
return Array.isArray(data?.tenants) ? data.tenants : []; return Array.isArray(data?.tenants) ? data.tenants : [];
}; };
export const setAuthToken = (token?: string | null) => { export const setAuthToken = (token: string) => {
if (token) {
api.defaults.headers.common.Authorization = `Bearer ${token}`; api.defaults.headers.common.Authorization = `Bearer ${token}`;
} else {
delete api.defaults.headers.common.Authorization;
}
}; };
export const clearAuthToken = () => { export const clearAuthToken = () => {