fix(ui): fix method context
This commit is contained in:
parent
ed954dea94
commit
a94d5f4904
2 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import logger from 'App/logger';
|
||||
import APIClient from './api_client';
|
||||
import { UPDATE_JWT } from './duck/user';
|
||||
import { LOGIN, UPDATE_JWT } from './duck/user';
|
||||
|
||||
export default () => (next) => (action) => {
|
||||
const { types, call, ...rest } = action;
|
||||
|
|
@ -14,7 +14,7 @@ export default () => (next) => (action) => {
|
|||
return call(client)
|
||||
.then(async (response) => {
|
||||
if (response.status === 403) {
|
||||
next({ type: UPDATE_JWT, data: null });
|
||||
next({ type: LOGIN.FAILURE, data: null });
|
||||
}
|
||||
if (!response.ok) {
|
||||
const text = await response.text();
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import apiMiddleware from './api_middleware';
|
|||
import LocalStorage from './local_storage';
|
||||
import { initialState as initUserState, UPDATE_JWT } from './duck/user'
|
||||
|
||||
// TODO @remove after few days
|
||||
localStorage.removeItem('jwt')
|
||||
|
||||
const storage = new LocalStorage({
|
||||
user: Object,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue