title: Re-authenticating User Credentials Swift
body: <p>I wish to re-authenticate a user prior to allowing them to change their login information. However, due to the recent Firebase update, I found the documentation rather unhelpful. Using <a href="https://firebase.google.com/docs/auth/ios/manage-users#re-authenticate_a_user" rel="noreferrer">this link</a> I produced the following authenticateUser() function.</p>
  
  <pre><code>func authenticateUser()
  {
      let user = FIRAuth.auth()?.currentUser
      var credential: FIRAuthCredential
  
      //prompt user to re-enter info
  
      user?.reauthenticateWithCredential(credential, completion: { (error) in
          if error != nil
          {
              self.displayAlertMessage("Error reauthenticating user")
          }
          else
          {
              //user reauthenticated successfully
          }
      })
  }
  </code></pre>
  
  <p>However, I am unsure what to do with the credential variable of type FIRAuthCredential, in order to re-authenticate the user. The documentation for this class can be found <a href="https://firebase.google.com/docs/reference/ios/firebaseauth/interface_f_i_r_auth_credential#properties" rel="noreferrer">here</a>.</p>