Skip to content

Commit

Permalink
Revert "Recaptcha integration master pr (#11231)"
Browse files Browse the repository at this point in the history
This reverts commit 032abb4.
  • Loading branch information
renkelvin authored Jul 26, 2023
1 parent 4084532 commit 6a919b1
Show file tree
Hide file tree
Showing 48 changed files with 189 additions and 2,286 deletions.
2 changes: 1 addition & 1 deletion FirebaseAuth.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ supports email and password accounts, as well as several 3rd party authenticatio
s.dependency 'GoogleUtilities/AppDelegateSwizzler', '~> 7.8'
s.dependency 'GoogleUtilities/Environment', '~> 7.8'
s.dependency 'GTMSessionFetcher/Core', '>= 2.1', '< 4.0'
s.ios.dependency 'RecaptchaInterop', '~> 18.2.0'

s.test_spec 'unit' do |unit_tests|
unit_tests.scheme = { :code_coverage => true }
# Unit tests can't run on watchOS.
Expand Down
301 changes: 10 additions & 291 deletions FirebaseAuth/Sources/Auth/FIRAuth.m

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ @implementation FIRAuthBackend (MultiFactor)
+ (void)startMultiFactorEnrollment:(FIRStartMFAEnrollmentRequest *)request
callback:(FIRStartMFAEnrollmentResponseCallback)callback {
FIRStartMFAEnrollmentResponse *response = [[FIRStartMFAEnrollmentResponse alloc] init];
[[self implementation] callWithRequest:request
[[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
Expand All @@ -38,7 +38,7 @@ + (void)startMultiFactorEnrollment:(FIRStartMFAEnrollmentRequest *)request
+ (void)finalizeMultiFactorEnrollment:(FIRFinalizeMFAEnrollmentRequest *)request
callback:(FIRFinalizeMFAEnrollmentResponseCallback)callback {
FIRFinalizeMFAEnrollmentResponse *response = [[FIRFinalizeMFAEnrollmentResponse alloc] init];
[[self implementation] callWithRequest:request
[[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
Expand All @@ -52,7 +52,7 @@ + (void)finalizeMultiFactorEnrollment:(FIRFinalizeMFAEnrollmentRequest *)request
+ (void)startMultiFactorSignIn:(FIRStartMFASignInRequest *)request
callback:(FIRStartMFASignInResponseCallback)callback {
FIRStartMFASignInResponse *response = [[FIRStartMFASignInResponse alloc] init];
[[self implementation] callWithRequest:request
[[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
Expand All @@ -66,7 +66,7 @@ + (void)startMultiFactorSignIn:(FIRStartMFASignInRequest *)request
+ (void)finalizeMultiFactorSignIn:(FIRFinalizeMFASignInRequest *)request
callback:(FIRFinalizeMFASignInResponseCallback)callback {
FIRFinalizeMFASignInResponse *response = [[FIRFinalizeMFASignInResponse alloc] init];
[[self implementation] callWithRequest:request
[[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
Expand All @@ -80,7 +80,7 @@ + (void)finalizeMultiFactorSignIn:(FIRFinalizeMFASignInRequest *)request
+ (void)withdrawMultiFactor:(FIRWithdrawMFARequest *)request
callback:(FIRWithdrawMFAResponseCallback)callback {
FIRWithdrawMFAResponse *response = [[FIRWithdrawMFAResponse alloc] init];
[[self implementation] callWithRequest:request
[[self implementation] postWithRequest:request
response:response
callback:^(NSError *error) {
if (error) {
Expand Down
43 changes: 7 additions & 36 deletions FirebaseAuth/Sources/Backend/FIRAuthBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
@class FIRSignUpNewUserResponse;
@class FIRRevokeTokenRequest;
@class FIRRevokeTokenResponse;
@class FIRGetRecaptchaConfigRequest;
@class FIRGetRecaptchaConfigResponse;

@protocol FIRAuthBackendImplementation;
@protocol FIRAuthBackendRPCIssuer;
Expand Down Expand Up @@ -243,15 +241,6 @@ typedef void (^FIRRevokeTokenResponseCallback)(FIRRevokeTokenResponse *_Nullable
typedef void (^FIRSignInWithGameCenterResponseCallback)(
FIRSignInWithGameCenterResponse *_Nullable response, NSError *_Nullable error);

/** @typedef FIRGetRecaptchaConfigResponseCallback
@brief The type of block used to return the result of a call to the getRecaptchaConfig endpoint.
@param response The received response, if any.
@param error The error which occurred, if any.
@remarks One of response or error will be non-nil.
*/
typedef void (^FIRGetRecaptchaConfigResponseCallback)(
FIRGetRecaptchaConfigResponse *_Nullable response, NSError *_Nullable error);

/** @class FIRAuthBackend
@brief Simple static class with methods representing the backend RPCs.
@remarks All callback blocks passed as method parameters are invoked asynchronously on the
Expand Down Expand Up @@ -409,15 +398,6 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
+ (void)signInWithGameCenter:(FIRSignInWithGameCenterRequest *)request
callback:(FIRSignInWithGameCenterResponseCallback)callback;

/** @fn getRecaptchaConfig:callback:
@brief Calls the getRecaptchaConfig endpoint, which is responsible for retrieving the recaptcha
configs including site key, provider enablement status.
@param request The request parameters.
@param callback The callback.
*/
+ (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
callback:(FIRGetRecaptchaConfigResponseCallback)callback;

#if TARGET_OS_IOS
/** @fn sendVerificationCode:callback:
@brief Calls the sendVerificationCode endpoint, which is responsible for sending the
Expand Down Expand Up @@ -464,16 +444,16 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
*/
@protocol FIRAuthBackendRPCIssuer <NSObject>

/** @fn asyncCallToURLWithRequestConfiguration:URL:body:contentType:completionHandler:
@brief Asynchronously sends a HTTP request.
/** @fn asyncPostToURLWithRequestConfiguration:URL:body:contentType:completionHandler:
@brief Asynchronously seXnds a POST request.
@param requestConfiguration The request to be made.
@param URL The request URL.
@param body Request body.
@param contentType Content type of the body.
@param handler provided that handles HTTP response. Invoked asynchronously on the auth global
@param handler provided that handles POST response. Invoked asynchronously on the auth global
work queue in the future.
*/
- (void)asyncCallToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
- (void)asyncPostToURLWithRequestConfiguration:(FIRAuthRequestConfiguration *)requestConfiguration
URL:(NSURL *)URL
body:(nullable NSData *)body
contentType:(NSString *)contentType
Expand Down Expand Up @@ -640,15 +620,6 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
- (void)signInWithGameCenter:(FIRSignInWithGameCenterRequest *)request
callback:(FIRSignInWithGameCenterResponseCallback)callback;

/** @fn getRecaptchaConfig:callback:
@brief Calls the getRecaptchaConfig endpoint, which is responsible for retrieving the recaptcha
configs including site key, provider enablement status.
@param request The request parameters.
@param callback The callback.
*/
- (void)getRecaptchaConfig:(FIRGetRecaptchaConfigRequest *)request
callback:(FIRGetRecaptchaConfigResponseCallback)callback;

/** @fn resetPassword:callback
@brief Calls the resetPassword endpoint, which is responsible for resetting a user's password
given an OOB code and new password.
Expand All @@ -658,8 +629,8 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
- (void)resetPassword:(FIRResetPasswordRequest *)request
callback:(FIRResetPasswordCallback)callback;

/** @fn callWithRequest:response:callback:
@brief Calls the RPC using HTTP request.
/** @fn postWithRequest:response:callback:
@brief Calls the RPC using HTTP POST.
@remarks Possible error responses:
@see FIRAuthInternalErrorCodeRPCRequestEncodingError
@see FIRAuthInternalErrorCodeJSONSerializationError
Expand All @@ -671,7 +642,7 @@ typedef void (^FIRGetRecaptchaConfigResponseCallback)(
@param response The empty response to be filled.
@param callback The callback for both success and failure.
*/
- (void)callWithRequest:(id<FIRAuthRPCRequest>)request
- (void)postWithRequest:(id<FIRAuthRPCRequest>)request
response:(id<FIRAuthRPCResponse>)response
callback:(void (^)(NSError *_Nullable error))callback;

Expand Down
Loading

0 comments on commit 6a919b1

Please sign in to comment.