File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 14361436 } ;
14371437
14381438 UserService . prototype = {
1439- _wrapAsync : function ( async ) {
1439+ _wrapAsync : function ( async , stayLoggedIn ) {
14401440 var me = this , success = function ( data ) {
1441- currentUser = me . _parseResponse ( tryParseJSON ( data ) ) ;
1441+ currentUser = me . _parseResponse ( tryParseJSON ( data ) , stayLoggedIn ) ;
14421442 async . success ( me . _getUserFromResponse ( currentUser ) ) ;
14431443 } , error = function ( data ) {
14441444 async . fault ( data ) ;
15461546 throw new Error ( 'Password can not be empty' ) ;
15471547 }
15481548
1549+ stayLoggedIn = stayLoggedIn === true ;
1550+
15491551 Backendless . LocalCache . remove ( "user-token" ) ;
15501552 Backendless . LocalCache . remove ( "current-user-id" ) ;
15511553 Backendless . LocalCache . set ( "stayLoggedIn" , false ) ;
15541556 var isAsync = responder != null ;
15551557
15561558 if ( responder ) {
1557- responder = this . _wrapAsync ( responder ) ;
1559+ responder = this . _wrapAsync ( responder , stayLoggedIn ) ;
15581560 }
15591561
15601562 var data = {
15711573 } ) ;
15721574
15731575 if ( ! isAsync && result ) {
1574- currentUser = this . _parseResponse ( result , stayLoggedIn === true ) ;
1576+ currentUser = this . _parseResponse ( result , stayLoggedIn ) ;
15751577 result = this . _getUserFromResponse ( currentUser ) ;
15761578 }
15771579
You can’t perform that action at this time.
0 commit comments