mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-13 00:22:23 +00:00
chore(ui): add loggedInAPI to show actual error instead generic one (#20110)
This commit is contained in:
parent
064b43f2e0
commit
28a69eaa27
@ -38,6 +38,7 @@ import React, {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
import { UN_AUTHORIZED_EXCLUDED_PATHS } from '../../../constants/Auth.constants';
|
||||||
import {
|
import {
|
||||||
DEFAULT_DOMAIN_VALUE,
|
DEFAULT_DOMAIN_VALUE,
|
||||||
ES_MAX_PAGE_SIZE,
|
ES_MAX_PAGE_SIZE,
|
||||||
@ -524,7 +525,7 @@ export const AuthProvider = ({
|
|||||||
if (status === ClientErrors.UNAUTHORIZED) {
|
if (status === ClientErrors.UNAUTHORIZED) {
|
||||||
// For login or refresh we don't want to fire another refresh req
|
// For login or refresh we don't want to fire another refresh req
|
||||||
// Hence rejecting it
|
// Hence rejecting it
|
||||||
if (['/users/refresh', '/users/login'].includes(error.config.url)) {
|
if (UN_AUTHORIZED_EXCLUDED_PATHS.includes(error.config.url)) {
|
||||||
return Promise.reject(error as Error);
|
return Promise.reject(error as Error);
|
||||||
}
|
}
|
||||||
handleStoreProtectedRedirectPath();
|
handleStoreProtectedRedirectPath();
|
||||||
|
|||||||
@ -32,3 +32,9 @@ export const HTTP_STATUS_CODE = {
|
|||||||
FAILED_DEPENDENCY: 424, // The method could not be performed on the resource because the requested action depended on another action and that action failed.
|
FAILED_DEPENDENCY: 424, // The method could not be performed on the resource because the requested action depended on another action and that action failed.
|
||||||
LIMIT_REACHED: 429, // Entity creation limit reached
|
LIMIT_REACHED: 429, // Entity creation limit reached
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const UN_AUTHORIZED_EXCLUDED_PATHS = [
|
||||||
|
'/users/refresh',
|
||||||
|
'/users/login',
|
||||||
|
'/users/loggedInUser',
|
||||||
|
];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user