persist only jwt token

This commit is contained in:
2019-01-03 22:35:45 +03:00
parent ca773d5b2d
commit 4206b4da3c
2 changed files with 5 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ import { combineReducers } from "redux";
import { persistReducer } from "redux-persist";
import storage from "redux-persist/lib/storage";
import { authReducer, IAuthState } from "~redux/auth/reducer";
import { IUserState, userReducer } from "./user/reducer";
export interface IAppState {
@@ -10,8 +11,9 @@ export interface IAppState {
}
const authPersistConfig = {
key: "jwt",
key: "auth",
storage,
whitelist: ["jwt"],
};
export const rootReducer = combineReducers({

View File

@@ -1,14 +1,7 @@
import { delay } from "redux-saga";
import {
all,
call,
cancel,
fork,
put,
race,
takeLatest,
} from "redux-saga/effects";
import { all, call, put, race, takeLatest } from "redux-saga/effects";
import { fetchUser } from "~redux/api/user";
import { getUserFail, getUserSuccess, UserTypes } from "./actions";
function* getUser() {