Skip to content

Commit 7b15ec3

Browse files
authored
Merge pull request #1157 from zhx828/hotfix-2
Do not reload the page when authentication endpoint failed
2 parents f96b287 + 7a81790 commit 7b15ec3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/webapp/app/config/constants.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,10 @@ export enum PAGE_ROUTE {
609609
ACCOUNT_ACTIVE_TRIAL_FINISH = '/account/active-trial/finish',
610610
}
611611

612+
export enum API_ROUTE {
613+
AUTHENTICATE = '/api/authenticate',
614+
}
615+
612616
export enum TABLE_COLUMN_KEY {
613617
HUGO_SYMBOL = 'HUGO_SYMBOL',
614618
ALTERATION = 'ALTERATION',

src/main/webapp/app/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
getPublicWebsiteToken,
2424
getStoredRecaptchaToken,
2525
} from 'app/indexUtils';
26-
import { UNAUTHORIZED_ALLOWED_PATH } from 'app/config/constants';
26+
import { API_ROUTE, UNAUTHORIZED_ALLOWED_PATH } from 'app/config/constants';
2727
import { AppConfig, AppProfile } from 'app/appConfig';
2828

2929
assignPublicToken();
@@ -79,6 +79,8 @@ superagent.Request.prototype.end = function (callback) {
7979
AppConfig.serverConfig.token &&
8080
AppConfig.serverConfig.appProfile === AppProfile.PROD &&
8181
response.req &&
82+
// we do not reload the page when the /api/authenticate failed
83+
response.req.url !== API_ROUTE.AUTHENTICATE &&
8284
UNAUTHORIZED_ALLOWED_PATH.some(path =>
8385
window.location.pathname.endsWith(path)
8486
)

0 commit comments

Comments
 (0)