File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 5151 "webpack" : " 2.2.1"
5252 },
5353 "dependencies" : {
54- "localforage" : " ^1.4.0 || ^1.5.0" ,
55- "react-router" : " ^2.3.0 || ^3.0.0"
54+ "localforage" : " ^1.4.0 || ^1.5.0"
5655 },
5756 "peerDependencies" : {
5857 "react" : " ^0.14.0 || ^15.0.0" ,
Original file line number Diff line number Diff line change 11import * as constant from './constants' ;
22import * as localForage from 'localforage' ;
3- import { browserHistory } from 'react-router' ;
43import {
54 getSessionSuccess ,
65 getSessionError ,
@@ -90,7 +89,6 @@ export class sessionService {
9089 static deleteSession ( ) {
9190 return localForage . removeItem ( constant . USER_SESSION ) . then ( ( ) => {
9291 instance . store . dispatch ( getSessionError ( ) ) ;
93- browserHistory . replace ( instance . redirectPath ) ;
9492 } ) . catch ( err => err ) ;
9593 }
9694
Original file line number Diff line number Diff line change @@ -7,16 +7,25 @@ import {
77
88export const initialState = {
99 authenticated : false ,
10+ checked : false ,
1011 user : { }
1112} ;
1213
1314const reducer = ( state = initialState , action ) => {
1415 switch ( action . type ) {
1516 case GET_SESSION_SUCCESS : {
16- return { user : { ...state . user } , authenticated : true } ;
17+ return {
18+ user : { ...state . user } ,
19+ authenticated : true ,
20+ checked : true
21+ } ;
1722 }
1823 case GET_SESSION_ERROR : {
19- return { user : { ...state . user } , authenticated : false } ;
24+ return {
25+ user : { ...state . user } ,
26+ authenticated : false ,
27+ checked : true
28+ } ;
2029 }
2130 case GET_USER_SESSION_SUCCESS : {
2231 return { ...state , user : action . user } ;
You can’t perform that action at this time.
0 commit comments