Password Change
The typical password-change flow in a mobile application consists of the following steps:
-
Prompt the user for their current password.
- Validate the current password with the server:
powerAuthSDK.beginPasswordChange(oldPassword: "oldPassword") { changeData, error in if let changeData { // Password is valid, keep this object aside and use in the step 4. } else { // Process error. } }Keep the received
changeDataobject aside for later. If the user cancels the process after this step, you should either release the storedchangeDataobject or callsecureClear()to ensure that all sensitive information is destroyed:changeData.secureClear() -
If the current password is valid, allow the user to enter and confirm a new password.
- Submit the new password to the server:
powerAuthSDK.finishPasswordChange(newPassword: "newPassword", changeData: changeData) { error in if let error { // process error } }
Read Next
Last updated on Oct 23, 2026 (12:47)
Edit on Github
Send Feedback