@@ -96,7 +96,7 @@ module.exports = function(AV) {
9696
9797 _handleSaveResult : function ( makeCurrent ) {
9898 // Clean up and synchronize the authData object, removing any unset values
99- if ( makeCurrent && ! AV . User . _currentUserDisabled ) {
99+ if ( makeCurrent && ! AV . _config . disableCurrentUser ) {
100100 this . _isCurrentUser = true ;
101101 }
102102 this . _cleanupAuthData ( ) ;
@@ -105,7 +105,7 @@ module.exports = function(AV) {
105105 delete this . _serverData . password ;
106106 this . _rebuildEstimatedDataForKey ( "password" ) ;
107107 this . _refreshCache ( ) ;
108- if ( ( makeCurrent || this . isCurrent ( ) ) && ! AV . User . _currentUserDisabled ) {
108+ if ( ( makeCurrent || this . isCurrent ( ) ) && ! AV . _config . disableCurrentUser ) {
109109 // Some old version of leanengine-node-sdk will overwrite
110110 // AV.User._saveCurrentUser which returns no Promise.
111111 // So we need a Promise wrapper.
@@ -606,8 +606,6 @@ module.exports = function(AV) {
606606 // The mapping of auth provider names to actual providers
607607 _authProviders : { } ,
608608
609- _currentUserDisabled : false ,
610-
611609 // Class Methods
612610
613611 /**
@@ -797,7 +795,7 @@ module.exports = function(AV) {
797795 * <code>current</code> will return <code>null</code>.
798796 */
799797 logOut : function ( ) {
800- if ( AV . User . _currentUserDisabled ) {
798+ if ( AV . _config . disableCurrentUser ) {
801799 return console . warn ( 'AV.User\'s currentUser disabled, use User#logOut instead' ) ;
802800 }
803801
@@ -978,7 +976,7 @@ module.exports = function(AV) {
978976 * @return {AV.Promise } resolved with the currently logged in AV.User.
979977 */
980978 currentAsync : function ( ) {
981- if ( AV . User . _currentUserDisabled ) {
979+ if ( AV . _config . disableCurrentUser ) {
982980 console . warn ( 'AV.User\'s currentUser disabled, access user from request instead' ) ;
983981 return AV . Promise . as ( null ) ;
984982 }
@@ -1027,7 +1025,7 @@ module.exports = function(AV) {
10271025 * @return {AV.Object } The currently logged in AV.User.
10281026 */
10291027 current : function ( ) {
1030- if ( AV . User . _currentUserDisabled ) {
1028+ if ( AV . _config . disableCurrentUser ) {
10311029 console . warn ( 'AV.User\'s currentUser disabled, access user from request instead' ) ;
10321030 return null ;
10331031 }
@@ -1067,10 +1065,6 @@ module.exports = function(AV) {
10671065 return AV . User . _currentUser ;
10681066 } ,
10691067
1070- disableCurrentUser : function ( ) {
1071- AV . User . _currentUserDisabled = true ;
1072- } ,
1073-
10741068 /**
10751069 * Persists a user as currentUser to localStorage, and into the singleton.
10761070 */
0 commit comments