> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/how-the-apps-work/screens/account/set-password.md).

# Set password

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). Platforms: iOS and Android. [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/screens/account/set-password.md).
{% endhint %}

Replace a temporary password, or set the first password, before going on. A reset link opens [Reset your password](https://docs.snapfix.com/how-the-apps-work/screens/account/reset-password.md) instead.

* **Where:** iOS `ChoosePasswordVC`; Android `CreateNewPasswordActivity`. They open at launch or straight after a sign-in, when the account's password is temporary or the username check returned a session and no password ([Sign in](https://docs.snapfix.com/how-the-apps-work/screens/account/sign-in.md), [Forgot password code](https://docs.snapfix.com/how-the-apps-work/screens/account/forgot-password-code.md), [App launch](https://docs.snapfix.com/product/features/account/app-launch.md)).
* **Who:** people whose account has a temporary password, usually set by an admin or by the [legacy reset](https://docs.snapfix.com/how-the-apps-work/screens/account/legacy-reset.md). The only ways past the screen are setting a password or logging out.
* **Feature:** [Password reset](https://docs.snapfix.com/product/features/account/password-reset.md)

## Layout

Top to bottom, on both apps:

1. A back arrow, which logs out.
2. "Almost there, Jane!", with the user's first name.
3. "Your username is <jane@example.com>" or "Your phone number is +353871234567". The label and the value are bold.
4. "Now, please set a password to secure your account.", or "Now, please create a password to secure your account." when the screen opens from a link (a sign-in from a deep link).
5. "Password" and "Confirm Password" (Android: "Confirm password"), each with a show and hide eye and a tick when it passes.
6. The rules: "Must be :", "- 8 characters minimum", "- contain at least one number", "- one uppercase letter", "- one lowercase letter." Each part changes style when met.
7. The code block, when verification is required (see [Verification](#verification)).
8. "Set Password", or "Complete Registration" when the screen opens from a link. Android writes it in capitals then: "COMPLETE REGISTRATION".
9. "Need help? Contact support".

## Inputs

| Field            | Type                                      | Required          | Default | Rules and messages                                                                                                                                                                                                                                                                                                           |
| ---------------- | ----------------------------------------- | ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Password         | Password                                  | Yes               | Empty   | At least 8 characters, one number, one uppercase and one lowercase letter. iOS: the button stays off until all four pass. Android: a space also makes the password fail. The confirmation field's check needs all the rules, but changing the password field to match a typed confirmation turns the button on without them. |
| Confirm password | Password                                  | Yes               | Empty   | Must match the password. The tick shows only when both match.                                                                                                                                                                                                                                                                |
| Code             | Six digits, when verification is required | Yes, in that case | Empty   | The button waits for six digits. A refused code shows the server's message (iOS alert, Android toast); Android also has an "Invalid code" line under the boxes.                                                                                                                                                              |

## Verification

When the server says the account needs verifying and the contact used to sign in is not verified yet, the code block appears.

* Both apps send a code when the screen opens. iOS shows "Enter the six digits code from the SMS message to verify your account." (or the email version), "The SMS code is valid for 5 minutes." or the email validity sentence, "Resend code", and a 30-second countdown. Android shows its SMS or email sentence, the same validity line, the six boxes and "Resend code" with a countdown.
* The code is checked before the password is saved. A right code marks the email or phone as verified on the device.
* For a phone, iOS can first open an SMS or WhatsApp choice. It is behind `whatsappOTPEnabled`, which is off.

## Actions

| Action                                   | Who                       | What happens                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | API                                                                                                                                                                                                                    |
| ---------------------------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| "Set Password" / "Complete Registration" | Anyone on the screen      | When a code is required, checks it first. Then saves the password (`user_uuid`, `password_new`), renews the session and signs in. iOS stores the new password on the device and opens the app or [Reloading Snapfix](https://docs.snapfix.com/how-the-apps-work/screens/account/download-data.md); a failed save shows "Something went wrong". Android opens [Reloading Snapfix](https://docs.snapfix.com/how-the-apps-work/screens/account/download-data.md), or the app when the person was already signed in; a failed save shows the server's message as a toast. | [`?action=set_user_password_v9`](https://docs.snapfix.com/engineering-reference/api/auth.md); the code: the generate and verify code actions in [Auth API](https://docs.snapfix.com/engineering-reference/api/auth.md) |
| "Resend code"                            | Anyone waiting for a code | Sends a new code to the same contact and restarts the countdown. iOS shows a toast, "Verification Code Sent successfully!".                                                                                                                                                                                                                                                                                                                                                                                                                                           | the generate code action in [Auth API](https://docs.snapfix.com/engineering-reference/api/auth.md)                                                                                                                     |
| Back arrow                               | Anyone                    | Logs out to [Sign in](https://docs.snapfix.com/how-the-apps-work/screens/account/sign-in.md). iOS first turns off the password step and clears the password-required flag.                                                                                                                                                                                                                                                                                                                                                                                            | -                                                                                                                                                                                                                      |
| "Contact support"                        | Anyone                    | Opens an email to support. Android shows "No email app founded in this device." when there is none.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | -                                                                                                                                                                                                                      |

## States

* **Loading:** a progress dialog while the code is sent, while it is checked and while the password is saved. iOS shows "Refreshing...".
* **Empty:** the button is disabled until the password, the confirmation and, when shown, the six-digit code are acceptable.
* **Error:** the messages in [Inputs](#inputs) and [Actions](#actions).
* **No permission:** none; the person is already signed in with the temporary session.
* **Offline (mobile):** iOS shows its connection alert before saving and stays on the screen. Android shows "You must be connected to the Internet to carry out this task. Please connect and try again." and stays.

## Dialogs and sheets

* **Channel choice (iOS, phone accounts):** a sheet with the masked number and SMS or WhatsApp. It is not shown while WhatsApp codes are off.

## Platform differences

| Topic                   | iOS                                                                                                         | Android                                                                                                                             |
| ----------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Button from a link      | "Complete Registration"                                                                                     | "COMPLETE REGISTRATION"                                                                                                             |
| What enables the button | all four rules, a match, and the code when required                                                         | a match and the code; the rules only through the confirmation field                                                                 |
| Space in the password   | allowed                                                                                                     | not accepted                                                                                                                        |
| Code entry              | one six-character field                                                                                     | six one-digit boxes                                                                                                                 |
| Refused code            | alert with the server's message                                                                             | toast with the server's message                                                                                                     |
| After saving            | the app or [Reloading Snapfix](https://docs.snapfix.com/how-the-apps-work/screens/account/download-data.md) | [Reloading Snapfix](https://docs.snapfix.com/how-the-apps-work/screens/account/download-data.md), or the app when already signed in |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/how-the-apps-work/screens/account/set-password.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
