File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ export class sessionService {
4444 const rc = req . get ( 'cookie' ) ;
4545 rc && rc . split ( ';' ) . forEach ( cookie => {
4646 const parts = cookie . split ( '=' ) ;
47- list [ parts [ 0 ] . trim ( ) ] = JSON . parse ( decodeURIComponent ( parts [ 1 ] ) ) ;
47+ if ( parts [ 0 ] . trim ( ) === USER_SESSION || parts [ 0 ] . trim ( ) === USER_DATA ) {
48+ list [ parts [ 0 ] . trim ( ) ] = JSON . parse ( decodeURIComponent ( parts [ 1 ] ) ) ;
49+ }
4850 } ) ;
4951
5052 return list ;
@@ -53,9 +55,13 @@ export class sessionService {
5355 }
5456
5557 static saveFromClient ( cookies ) {
56- if ( Object . keys ( cookies ) . length > 0 ) {
58+ if ( cookies [ USER_SESSION ] ) {
5759 sessionService . saveSession ( cookies [ USER_SESSION ] )
58- . then ( ( ) => sessionService . saveUser ( cookies [ USER_DATA ] ) ) ;
60+ . then ( ( ) => {
61+ if ( cookies [ USER_DATA ] ) {
62+ sessionService . saveUser ( cookies [ USER_DATA ] ) ;
63+ }
64+ } ) ;
5965 }
6066 }
6167
You can’t perform that action at this time.
0 commit comments