|
|
|
@@ -15,6 +15,7 @@ import { |
|
|
|
fetchUserError, |
|
|
|
fetchUserSuccess, |
|
|
|
resetLoginState, |
|
|
|
setUserJwtToken, |
|
|
|
} from "../actions/login/loginActions"; |
|
|
|
import { LOGIN_PAGE } from "../../constants/pages"; |
|
|
|
import { addHeaderToken, removeHeaderToken } from "../../request"; |
|
|
|
@@ -30,7 +31,6 @@ import { |
|
|
|
authScopeSetHelper, |
|
|
|
} from "../../util/helpers/authScopeHelpers"; |
|
|
|
import { rejectErrorCodeHelper } from "../../util/helpers/rejectErrorCodeHelper"; |
|
|
|
import { setUserAccessToken } from "../actions/user/userActions"; |
|
|
|
import i18next from "i18next"; |
|
|
|
import { attemptFetchProfile } from "../../request/profileRequest"; |
|
|
|
import { clearProfile, setMineProfile } from "../actions/profile/profileActions"; |
|
|
|
@@ -127,7 +127,8 @@ function* logout(payload) { |
|
|
|
function* refreshUserToken({payload}) { |
|
|
|
try { |
|
|
|
const newTokenDecoded = jwt.decode(payload); |
|
|
|
yield put(setUserAccessToken({token: payload, exp: newTokenDecoded.exp})); |
|
|
|
|
|
|
|
yield put(setUserJwtToken({token: payload, exp: newTokenDecoded.exp})); |
|
|
|
yield call(addHeaderToken, payload); |
|
|
|
yield call(authScopeSetHelper, JWT_TOKEN, payload); |
|
|
|
} |