Fix linting
This commit is contained in:
@@ -375,7 +375,7 @@ export const getAuthStatus = async (): Promise<AuthStatusResponse> => {
|
||||
'Accept': 'application/json' // Explicitly request JSON
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Check if response is HTML (which indicates a redirect or wrong endpoint)
|
||||
const contentType = response.headers['content-type'] || '';
|
||||
if (contentType.includes('text/html')) {
|
||||
@@ -385,13 +385,13 @@ export const getAuthStatus = async (): Promise<AuthStatusResponse> => {
|
||||
auth_mode: 'enabled'
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Strict validation of the response data
|
||||
if (response.data &&
|
||||
if (response.data &&
|
||||
typeof response.data === 'object' &&
|
||||
'auth_configured' in response.data &&
|
||||
typeof response.data.auth_configured === 'boolean') {
|
||||
|
||||
|
||||
// For unconfigured auth, ensure we have an access token
|
||||
if (!response.data.auth_configured) {
|
||||
if (response.data.access_token && typeof response.data.access_token === 'string') {
|
||||
@@ -404,10 +404,10 @@ export const getAuthStatus = async (): Promise<AuthStatusResponse> => {
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If response data is invalid but we got a response, log it
|
||||
console.warn('Received invalid auth status response:', response.data);
|
||||
|
||||
|
||||
// Default to auth configured if response is invalid
|
||||
return {
|
||||
auth_configured: true,
|
||||
|
Reference in New Issue
Block a user