Просмотр исходного кода

Merged with chat-init

feature/code-cleanup-joca
Djordje Mitrovic 3 лет назад
Родитель
Сommit
25a0fd1864

+ 1
- 1
src/components/ChatColumn/ChatColumn.js Просмотреть файл

import React, { useState, useEffect } from "react";
import React, { useState, useEffect } from "react";
import ChatCard from "../Cards/ChatCard/ChatCard"; import ChatCard from "../Cards/ChatCard/ChatCard";
import { import {
ChatColumnContainer, ChatColumnContainer,

+ 1
- 1
src/store/actions/login/loginActions.js Просмотреть файл

payload, payload,
}); });


export const updateUserToken = (payload) => ({
export const setUserJwtToken = (payload) => ({
type: UPDATE_USER_JWT_TOKEN, type: UPDATE_USER_JWT_TOKEN,
payload, payload,
}); });

+ 3
- 2
src/store/saga/loginSaga.js Просмотреть файл

fetchUserError, fetchUserError,
fetchUserSuccess, fetchUserSuccess,
resetLoginState, resetLoginState,
setUserJwtToken,
} from "../actions/login/loginActions"; } from "../actions/login/loginActions";
import { LOGIN_PAGE } from "../../constants/pages"; import { LOGIN_PAGE } from "../../constants/pages";
import { addHeaderToken, removeHeaderToken } from "../../request"; import { addHeaderToken, removeHeaderToken } from "../../request";
authScopeSetHelper, authScopeSetHelper,
} from "../../util/helpers/authScopeHelpers"; } from "../../util/helpers/authScopeHelpers";
import { rejectErrorCodeHelper } from "../../util/helpers/rejectErrorCodeHelper"; import { rejectErrorCodeHelper } from "../../util/helpers/rejectErrorCodeHelper";
import { setUserAccessToken } from "../actions/user/userActions";
import i18next from "i18next"; import i18next from "i18next";
import { attemptFetchProfile } from "../../request/profileRequest"; import { attemptFetchProfile } from "../../request/profileRequest";
import { clearProfile, setMineProfile } from "../actions/profile/profileActions"; import { clearProfile, setMineProfile } from "../actions/profile/profileActions";
function* refreshUserToken({payload}) { function* refreshUserToken({payload}) {
try { try {
const newTokenDecoded = jwt.decode(payload); 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(addHeaderToken, payload);
yield call(authScopeSetHelper, JWT_TOKEN, payload); yield call(authScopeSetHelper, JWT_TOKEN, payload);
} }

Загрузка…
Отмена
Сохранить