[auth] Remove superfluous getCurrentUser method which doesn’t exist in API
This commit is contained in:
parent
63859b311d
commit
285e31df65
|
@ -350,26 +350,6 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getCurrentUser - returns the current user, probably no need for this due to
|
||||
* js side already listening for user auth changes
|
||||
*
|
||||
* @param promise
|
||||
*/
|
||||
@ReactMethod
|
||||
public void getCurrentUser(String appName, final Promise promise) {
|
||||
FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
|
||||
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp);
|
||||
|
||||
FirebaseUser user = firebaseAuth.getCurrentUser();
|
||||
Log.d(TAG, "getCurrentUser");
|
||||
if (user == null) {
|
||||
promiseNoUser(promise, false);
|
||||
} else {
|
||||
promiseWithUser(user, promise);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------
|
||||
* .currentUser methods
|
||||
* ---------------------- */
|
||||
|
|
|
@ -610,25 +610,6 @@ RCT_EXPORT_METHOD(sendPasswordResetEmail:(NSString *) appDisplayName
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
getCurrentUser
|
||||
|
||||
@param RCTPromiseResolveBlock resolve
|
||||
@param RCTPromiseRejectBlock reject
|
||||
@return
|
||||
*/
|
||||
RCT_EXPORT_METHOD(getCurrentUser:
|
||||
(NSString *) appDisplayName
|
||||
resolver:
|
||||
(RCTPromiseResolveBlock) resolve
|
||||
rejecter:
|
||||
(RCTPromiseRejectBlock) reject) {
|
||||
FIRApp *firApp = [RNFirebaseUtil getApp:appDisplayName];
|
||||
|
||||
FIRUser *user = [FIRAuth authWithApp:firApp].currentUser;
|
||||
[self promiseWithUser:resolve rejecter:reject user:user];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
signInWithCustomToken
|
||||
|
|
|
@ -319,14 +319,6 @@ export default class Auth extends ModuleBase {
|
|||
return getNativeModule(this).checkActionCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the currently signed in user
|
||||
* @return {Promise}
|
||||
*/
|
||||
getCurrentUser(): Promise<User | null> {
|
||||
return this._interceptUserValue(getNativeModule(this).getCurrentUser());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of authentication providers that can be used to sign in a given user (identified by its main email address).
|
||||
* @return {Promise}
|
||||
|
|
Loading…
Reference in New Issue