Skip to content

Password change screen

This is the screen where the user changes the login password of an account linked to the username login method.

Screen examples

A single screen resource handles both portrait and landscape orientations. The following is a landscape example.

Landscape example of the password change screen. In the center of the screen is a dialog titled Change password, and inside it the Current password, New password, and Confirm new password input fields are placed from top to bottom. To the right of each input field is a button that makes the entered value visible, a confirm button is at the bottom of the dialog, and a close button is in its upper-right corner.

Usage scenarios

Open this screen when a user whose account is linked to the username login method changes the password. Because a password change applies only to the logged-in account, show this screen only to logged-in users. When the password is changed, the user's identity is verified with the current password.

The screen consists of the current password, new password, and new password confirmation input fields and a confirm button. When opened as a pop-up, it also shows a close button. To the right of each input field is a button that shows or hides the entered password.

Related recipes

There is no dedicated recipe for password changes. You implement it by calling the Hive Axyl SDK method directly from the app with the values received from the screen. The following recipe handles creating the username account whose password is changed on this screen and logging in with that account.

  • Username login practical guide: Implementation scope and prerequisites of the recipe that groups username account creation and login into a single method

Required SDK features

To actually process the change with the current password and the new password received from the screen, you need the following Hive Axyl SDK feature.

  • Change the password: Hive Axyl SDK feature that verifies the user's identity with the current password and changes it to the new password, and the processing to do after the change

Required APIs

The following is the Hive Axyl SDK method that the app calls to implement the feature above.

Applying to Unity

Keep the current password and the new password that the screen passes, and connect the confirm button so that selecting it runs the password change. The app converts the current password and the new password into hash strings and passes each of them to the method. For how to convert them, see Prepare the call parameter values in Change the password. The moment the user selects the confirm button, the screen locks the input fields and that button by itself. If the change fails and you keep showing the screen, call SetBusy(false) to release the lock. For how to close the screen, see Close a screen.

The input fields with a button that shows or hides the password and the failure toast to display when the change fails are shared widgets that multiple screens use, and they are in the common folder. When you copy the screen folder, also copy the common folder, the fonts folder, and the UIKit.asmdef file. For how to copy them and what to add to your app's assembly definition file after copying, see Import screen resources.

  • Unity GitHub repository: The unity/UI-Kit/PasswordChange, unity/UI-Kit/Common, and unity/UI-Kit/Fonts folders and the unity/UI-Kit/UIKit.asmdef file to copy