1919#import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDConfiguration.h"
2020#import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDGoogleUser.h"
2121#import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDProfileData.h"
22- #import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDUserAuth .h"
22+ #import " GoogleSignIn/Sources/Public/GoogleSignIn/GIDSignInResult .h"
2323
2424#import " GoogleSignIn/Sources/GIDEMMSupport.h"
2525#import " GoogleSignIn/Sources/GIDSignInInternalOptions.h"
3434
3535#import " GoogleSignIn/Sources/GIDGoogleUser_Private.h"
3636#import " GoogleSignIn/Sources/GIDProfileData_Private.h"
37- #import " GoogleSignIn/Sources/GIDUserAuth_Private .h"
37+ #import " GoogleSignIn/Sources/GIDSignInResult_Private .h"
3838
3939#ifdef SWIFT_PACKAGE
4040@import AppAuth;
@@ -201,9 +201,9 @@ - (BOOL)hasPreviousSignIn {
201201- (void )restorePreviousSignInWithCompletion : (nullable void (^)(GIDGoogleUser *_Nullable user,
202202 NSError *_Nullable error))completion {
203203 [self signInWithOptions: [GIDSignInInternalOptions silentOptionsWithCompletion:
204- ^(GIDUserAuth *userAuth , NSError *error) {
205- if (userAuth ) {
206- completion (userAuth .user , nil );
204+ ^(GIDSignInResult *signInResult , NSError *error) {
205+ if (signInResult ) {
206+ completion (signInResult .user , nil );
207207 } else {
208208 completion (nil , error);
209209 }
@@ -235,7 +235,7 @@ - (BOOL)restorePreviousSignInNoRefresh {
235235
236236- (void )signInWithPresentingViewController : (UIViewController *)presentingViewController
237237 hint : (nullable NSString *)hint
238- completion : (nullable GIDUserAuthCompletion )completion {
238+ completion : (nullable GIDSignInCompletion )completion {
239239 GIDSignInInternalOptions *options =
240240 [GIDSignInInternalOptions defaultOptionsWithConfiguration: _configuration
241241 presentingViewController: presentingViewController
@@ -248,7 +248,7 @@ - (void)signInWithPresentingViewController:(UIViewController *)presentingViewCon
248248- (void )signInWithPresentingViewController : (UIViewController *)presentingViewController
249249 hint : (nullable NSString *)hint
250250 additionalScopes : (nullable NSArray <NSString *> *)additionalScopes
251- completion : (nullable GIDUserAuthCompletion )completion {
251+ completion : (nullable GIDSignInCompletion )completion {
252252 GIDSignInInternalOptions *options =
253253 [GIDSignInInternalOptions defaultOptionsWithConfiguration: _configuration
254254 presentingViewController: presentingViewController
@@ -260,15 +260,15 @@ - (void)signInWithPresentingViewController:(UIViewController *)presentingViewCon
260260}
261261
262262- (void )signInWithPresentingViewController : (UIViewController *)presentingViewController
263- completion : (nullable GIDUserAuthCompletion )completion {
263+ completion : (nullable GIDSignInCompletion )completion {
264264 [self signInWithPresentingViewController: presentingViewController
265265 hint: nil
266266 completion: completion];
267267}
268268
269269- (void )addScopes : (NSArray <NSString *> *)scopes
270270 presentingViewController : (UIViewController *)presentingViewController
271- completion : (nullable GIDUserAuthCompletion )completion {
271+ completion : (nullable GIDSignInCompletion )completion {
272272 GIDConfiguration *configuration = self.currentUser .configuration ;
273273 GIDSignInInternalOptions *options =
274274 [GIDSignInInternalOptions defaultOptionsWithConfiguration: configuration
@@ -306,7 +306,7 @@ - (void)addScopes:(NSArray<NSString *> *)scopes
306306
307307- (void )signInWithPresentingWindow : (NSWindow *)presentingWindow
308308 hint : (nullable NSString *)hint
309- completion : (nullable GIDUserAuthCompletion )completion {
309+ completion : (nullable GIDSignInCompletion )completion {
310310 GIDSignInInternalOptions *options =
311311 [GIDSignInInternalOptions defaultOptionsWithConfiguration: _configuration
312312 presentingWindow: presentingWindow
@@ -317,7 +317,7 @@ - (void)signInWithPresentingWindow:(NSWindow *)presentingWindow
317317}
318318
319319- (void )signInWithPresentingWindow : (NSWindow *)presentingWindow
320- completion : (nullable GIDUserAuthCompletion )completion {
320+ completion : (nullable GIDSignInCompletion )completion {
321321 [self signInWithPresentingWindow: presentingWindow
322322 hint: nil
323323 completion: completion];
@@ -326,7 +326,7 @@ - (void)signInWithPresentingWindow:(NSWindow *)presentingWindow
326326- (void )signInWithPresentingWindow : (NSWindow *)presentingWindow
327327 hint : (nullable NSString *)hint
328328 additionalScopes : (nullable NSArray <NSString *> *)additionalScopes
329- completion : (nullable GIDUserAuthCompletion )completion {
329+ completion : (nullable GIDSignInCompletion )completion {
330330 GIDSignInInternalOptions *options =
331331 [GIDSignInInternalOptions defaultOptionsWithConfiguration: _configuration
332332 presentingWindow: presentingWindow
@@ -339,7 +339,7 @@ - (void)signInWithPresentingWindow:(NSWindow *)presentingWindow
339339
340340- (void )addScopes : (NSArray <NSString *> *)scopes
341341 presentingWindow : (NSWindow *)presentingWindow
342- completion : (nullable GIDUserAuthCompletion )completion {
342+ completion : (nullable GIDSignInCompletion )completion {
343343 GIDConfiguration *configuration = self.currentUser .configuration ;
344344 GIDSignInInternalOptions *options =
345345 [GIDSignInInternalOptions defaultOptionsWithConfiguration: configuration
@@ -529,8 +529,9 @@ - (void)signInWithOptions:(GIDSignInInternalOptions *)options {
529529 if (options.completion ) {
530530 self->_currentOptions = nil ;
531531 dispatch_async (dispatch_get_main_queue (), ^{
532- GIDUserAuth *userAuth = [[GIDUserAuth alloc ] initWithGoogleUser: self ->_currentUser serverAuthCode: nil ];
533- options.completion (userAuth, nil );
532+ GIDSignInResult *signInResult =
533+ [[GIDSignInResult alloc ] initWithGoogleUser: self ->_currentUser serverAuthCode: nil ];
534+ options.completion (signInResult, nil );
534535 });
535536 }
536537 }
@@ -843,7 +844,7 @@ - (void)addCompletionCallback:(GIDAuthFlow *)authFlow {
843844 [authFlow addCallback: ^() {
844845 GIDAuthFlow *handlerAuthFlow = weakAuthFlow;
845846 if (self->_currentOptions .completion ) {
846- GIDUserAuthCompletion completion = self->_currentOptions .completion ;
847+ GIDSignInCompletion completion = self->_currentOptions .completion ;
847848 self->_currentOptions = nil ;
848849 dispatch_async (dispatch_get_main_queue (), ^{
849850 if (handlerAuthFlow.error ) {
@@ -852,9 +853,10 @@ - (void)addCompletionCallback:(GIDAuthFlow *)authFlow {
852853 OIDAuthState *authState = handlerAuthFlow.authState ;
853854 NSString *_Nullable serverAuthCode =
854855 [authState.lastTokenResponse.additionalParameters[@" server_code" ] copy ];
855- GIDUserAuth *userAuth = [[GIDUserAuth alloc ] initWithGoogleUser: self ->_currentUser
856- serverAuthCode: serverAuthCode];
857- completion (userAuth, nil );
856+ GIDSignInResult *signInResult =
857+ [[GIDSignInResult alloc ] initWithGoogleUser: self ->_currentUser
858+ serverAuthCode: serverAuthCode];
859+ completion (signInResult, nil );
858860 }
859861 });
860862 }
0 commit comments