Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 79836ec

Browse files
after session expirted redirect to login page done
1 parent acaf4d7 commit 79836ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/services/api.request.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isArray } from 'lodash';
55
import axios from './api.config';
66
import { apiActions } from '../store/actions';
77
import store from '../store/configureStore';
8-
// import { handle401Error } from './authentication';
8+
import { SESSION } from './session';
99

1010
class ApiRequestClass {
1111
// constructor() {
@@ -70,7 +70,11 @@ class ApiRequestClass {
7070
/**
7171
* 401 is authentication error like session failure
7272
*/
73-
// handle401Error();
73+
toaster.error('Session expired');
74+
75+
setTimeout(() => {
76+
SESSION.logout();
77+
}, 1000);
7478
} else if (status === 422) {
7579
/**
7680
* 422 error is form validation error

0 commit comments

Comments
 (0)