Skip to content

Commit c1c4afe

Browse files
committed
Update GIDUserAuth refs to GIDSignInResult.
1 parent 38a5f5c commit c1c4afe

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

Samples/Swift/DaysUntilBirthday/Shared/ViewModels/AuthenticationViewModel.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ final class AuthenticationViewModel: ObservableObject {
6363
do {
6464

6565
#if os(iOS)
66-
let userAuth = try await authenticator.signIn(with: rootViewController)
66+
let signInResult = try await authenticator.signIn(with: rootViewController)
6767
#elseif os(macOS)
68-
let userAuth = try await authenticator.signIn(with: presentingWindow)
68+
let signInResult = try await authenticator.signIn(with: presentingWindow)
6969
#endif
70-
self.state = .signedIn(userAuth.user)
70+
self.state = .signedIn(signInResult.user)
7171
} catch {
7272
print("Error signing in: \(error)")
7373
}
@@ -98,9 +98,9 @@ final class AuthenticationViewModel: ObservableObject {
9898
#if os(iOS)
9999
/// Adds the requested birthday read scope.
100100
/// - parameter viewController: A `UIViewController` to use while presenting the flow.
101-
/// - returns: The resulting`GIDUserAuth`.
101+
/// - returns: The `GIDSignInResult`.
102102
/// - throws: Any error that may arise while adding the read birthday scope.
103-
func addBirthdayReadScope(viewController: UIViewController) async throws -> GIDUserAuth {
103+
func addBirthdayReadScope(viewController: UIViewController) async throws -> GIDSignInResult {
104104
return try await authenticator.addBirthdayReadScope(viewController: viewController)
105105
}
106106
#endif
@@ -109,9 +109,9 @@ final class AuthenticationViewModel: ObservableObject {
109109
#if os(macOS)
110110
/// adds the requested birthday read scope.
111111
/// - parameter window: An `NSWindow` to use while presenting the flow.
112-
/// - returns: The resulting `GIDUserAuth`.
112+
/// - returns: The `GIDSignInResult`.
113113
/// - throws: Any error that may arise while adding the read birthday scope.
114-
func addBirthdayReadScope(window: NSWindow) async throws -> GIDUserAuth {
114+
func addBirthdayReadScope(window: NSWindow) async throws -> GIDSignInResult {
115115
return try await authenticator.addBirthdayReadScope(window: window)
116116
}
117117
#endif

Samples/Swift/DaysUntilBirthday/iOS/UserProfileView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ struct UserProfileView: View {
4949
}
5050
Task { @MainActor in
5151
do {
52-
let userAuth = try await authViewModel.addBirthdayReadScope(
52+
let signInResult = try await authViewModel.addBirthdayReadScope(
5353
viewController: viewController
5454
)
55-
self.authViewModel.state = .signedIn(userAuth.user)
55+
self.authViewModel.state = .signedIn(signInResult.user)
5656
self.birthdayViewModel.fetchBirthday()
5757
} catch {
5858
print("Failed to fetch birthday: \(error)")

Samples/Swift/DaysUntilBirthday/macOS/UserProfileView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ struct UserProfileView: View {
4949
}
5050
Task { @MainActor in
5151
do {
52-
let userAuth = try await authViewModel.addBirthdayReadScope(window: window)
53-
self.authViewModel.state = .signedIn(userAuth.user)
52+
let signInResult =
53+
try await authViewModel.addBirthdayReadScope(window: window)
54+
self.authViewModel.state = .signedIn(signInResult.user)
5455
self.birthdayViewModel.fetchBirthday()
5556
} catch {
5657
print("Failed to fetch birthday: \(error)")

0 commit comments

Comments
 (0)