Просмотр исходного кода

No need to signOut after disconnect.

Peter Andrews 3 лет назад
Родитель
Сommit
560554e465

+ 1 - 0
Samples/Swift/DaysUntilBirthday/Shared/Services/GoogleSignInAuthenticator.swift

@@ -64,6 +64,7 @@ final class GoogleSignInAuthenticator {
   @MainActor
   func disconnect() async throws {
     try await GIDSignIn.sharedInstance.disconnect()
+    authViewModel.state = .signedOut
   }
 
 #if os(iOS)

+ 1 - 2
Samples/Swift/DaysUntilBirthday/Shared/ViewModels/AuthenticationViewModel.swift

@@ -78,12 +78,11 @@ final class AuthenticationViewModel: ObservableObject {
     authenticator.signOut()
   }
 
-  /// Disconnects the previously granted scope and logs the user out.
+  /// Disconnects the previously granted scope and signs the user out.
   func disconnect() {
     Task {
       do {
         try await authenticator.disconnect()
-        authenticator.signOut()
       } catch {
         print("Error disconnecting: \(error)")
       }