diff --git a/ui/src/shared/constants/index.js b/ui/src/shared/constants/index.js index 458fc0ceab..9c193e25f2 100644 --- a/ui/src/shared/constants/index.js +++ b/ui/src/shared/constants/index.js @@ -472,3 +472,5 @@ export const PRESENTATION_MODE_ANIMATION_DELAY = 0 // In milliseconds. export const PRESENTATION_MODE_NOTIFICATION_DELAY = 2000 // In milliseconds. export const ADMIN_NOTIFICATION_DELAY = 1500 // milliseconds + +export const RES_UNAUTHORIZED = 401 diff --git a/ui/src/utils/ajax.js b/ui/src/utils/ajax.js index 71d3fd48a7..e37f01cea1 100644 --- a/ui/src/utils/ajax.js +++ b/ui/src/utils/ajax.js @@ -2,7 +2,7 @@ import axios from 'axios'; let links -const UNAUTHORIZED = 401 +import {RES_UNAUTHORIZED} from 'shared/constants' export default async function AJAX({ url, @@ -47,10 +47,10 @@ export default async function AJAX({ } } catch (error) { const {response} = error - if (!response.status === UNAUTHORIZED) { + if (!response.status === RES_UNAUTHORIZED) { console.error(error) // eslint-disable-line no-console } - console.error(error) // eslint-disable-line no-console + // console.error(error) // eslint-disable-line no-console const {auth} = links throw {auth, ...response} // eslint-disable-line no-throw-literal }