Commit 46265c11 authored by Zhou Fang's avatar Zhou Fang Committed by Martin Lowe
Browse files

fixed a typo

parent f6a09e4e
......@@ -16,6 +16,7 @@ export const MEMBERSHIP_LEVEL = 'Membership Level';
export const WORKING_GROUPS = 'Working Groups';
export const SIGNING_AUTHORITY = 'Signing Authority';
export const REVIEW = 'Review';
export const HAS_TOKEN_EXPIRED = 'HAS_TOKEN_EXPIRED';
export const LOGIN_EXPIRED_MSG =
'Your session has expired, please sign in again.';
......
......@@ -9,6 +9,7 @@ import {
MODE_REACT_API,
OPTIONS_FOR_PURCHASING_PROCES,
PATH_NAME_ARRAY,
HAS_TOKEN_EXPIRED,
} from '../Constants/Constants';
/**
......@@ -703,11 +704,11 @@ export function requestErrorHandler(statusCode) {
window.location.assign(origin + '/50x');
break;
case 401:
sessionStorage.setItem('HAS_TOKEN_EXPIREd', 'true');
sessionStorage.setItem(HAS_TOKEN_EXPIRED, 'true');
window.location.assign(origin + '/');
break;
case 499:
sessionStorage.setItem('HAS_TOKEN_EXPIREd', 'true');
sessionStorage.setItem(HAS_TOKEN_EXPIRED, 'true');
window.location.assign(origin + '/');
break;
default:
......
......@@ -2,7 +2,7 @@ import { useCallback, useContext, useEffect, useState } from 'react';
import { Switch, Route, Redirect, useHistory } from 'react-router-dom';
import { useFormik } from 'formik';
import SignIn from './SignIn/SignIn';
import { LOGIN_EXPIRED_MSG, PAGE_STEP } from '../../Constants/Constants';
import { HAS_TOKEN_EXPIRED, LOGIN_EXPIRED_MSG, PAGE_STEP } from '../../Constants/Constants';
import { initialValues } from '../UIComponents/FormComponents/formFieldModel';
import CompanyInformation from './CompanyInformation/CompanyInformation';
import MembershipLevel from './MembershipLevel/MembershipLevel';
......@@ -219,8 +219,8 @@ export default function Application() {
});
const handleLoginExpired = useCallback(() => {
if (sessionStorage.getItem('HAS_TOKEN_EXPIREd')) {
sessionStorage.setItem('HAS_TOKEN_EXPIREd', '');
if (sessionStorage.getItem(HAS_TOKEN_EXPIRED)) {
sessionStorage.setItem(HAS_TOKEN_EXPIRED, '');
// using setTimeout here is to make the pop up message more noticeable
setTimeout(() => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment