title: How do I rerender my view in swiftUI after a user logged in with Google on Firebase?
body: <p>I'm fairly new to iOS Programming and swiftUI in particular. 
  I have the issue that I try to integrate firebase auth in my App in order to manage users.
  Now the login, and log out basically works, the issue is, that after logging in, my view (which conditionally renders eighter the Google sign-in button or a list of content does not rerender so I still see the sign-in button even though I'm signed in). </p>
  
  <p>I have set an observable Object to hold my auth status but unfortunately, it does not reload the current user automatically. So I set up a function to reload it manually which I would like to trigger when logging in. This works for the logout button but the logging in finishes in the AppDelegate, where for some reason I can't access the reloadUser() function.</p>
  
  <p>I'm sure there is a better way to do this and would appreciate any help!</p>
  
  <p>The Environment:</p>
  
  <pre><code>final class UserData: ObservableObject {
      @Published var showFavoritesOnly = false
      @Published var qrTags = qrTagData
      @Published var user: User? = Auth.auth().currentUser
  
      func reloadUser() -&gt; Void {
          self.user = Auth.auth().currentUser
      }
  }
  </code></pre>
  
  <p>The View I'd like to render:</p>
  
  <pre><code>struct MyQuaggsList: View {
          @EnvironmentObject private var userData: UserData
  
          var body: some View {
              Group {
                  if getLogInState() != nil {
                      VStack {
                          NavigationView {
                              List {
                                  Toggle(isOn: $userData.showFavoritesOnly) {
                                      Text("Show Favorites Only")
                                  }
  
                                  ForEach(userData.qrTags) { qrTag in
                                      if !self.userData.showFavoritesOnly || qrTag.isFavorite {
                                          NavigationLink(
                                              destination: QuagDetail(qrTag: qrTag)
                                                  .environmentObject(self.userData)
                                          ) {
                                              QuaggRow(qrTag: qrTag)
                                          }
                                      }
                                  }
                              }
                              .navigationBarTitle(Text("My Quaggs"))
                          }
                          SignOutButton()
                      }
                  } else {
                      SignInView()
                  }
              }.onAppear(perform: {self.userData.reloadUser()})
          }
  
          func getLogInState() -&gt; User? {
              return Auth.auth().currentUser
          }
      }
  </code></pre>
  
  <p>Also, note there is the .onAppear() function which unfortunately only triggers on the initial appear not on the reappearance of the view after the user logged in.</p>
  
  <p>Thanks so much in advance! It has been really frustrating.</p>