I want to re-authenticate the user before allowing them to change their login information. However, due to a recent Firebase update, I found the documentation pretty useless. Using this link , I produced the following authenticateUser () function.
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 } }) }
However, I'm not sure what to do with the credential variable of type FIRAuthCredential to re-authenticate the user. The documentation for this class can be found here .
authentication ios swift firebase firebase-authentication
sBourne
source share