> 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/forgot-password-code.md).

# Forgot password code

{% 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: web, iOS and Android. [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/screens/account/forgot-password-code.md).
{% endhint %}

Enter the one-time code requested on the forgot password screen, to sign in without a password.

* **Where:** web `/auth/forgot-password`, the code step in the same card; iOS: `SendOTPView`, pushed from [Forgot password](https://docs.snapfix.com/how-the-apps-work/screens/account/forgot-password.md); Android: `LoginWithOTPActivity`. All three open after "SEND ONE-TIME CODE".
* **Who:** signed-out users whose contact is verified.
* **Feature:** [Sign-in](https://docs.snapfix.com/product/features/account/sign-in.md)

Not checked live: the step opens only after a code is sent to a verified contact, and the live pass does not send codes \[[ASK-30](https://github.com/snapfix/docs/blob/main/ASK.md#ask-30-can-the-live-pass-reach-the-code-and-link-screens)]. The layout below is from code.

## Layout

1. A back arrow, then "Enter email code to log in" or "Enter SMS code to log in".
2. "We've sent a one-time code to" and the contact, in full on every platform (unlike [Login code](https://docs.snapfix.com/how-the-apps-work/screens/account/login-code.md)). Android shows a phone as "+353 871234567".
3. The validity note. Email: "The email code is valid for 5 minutes. Make sure to check your Spam/Junk folder." (iOS puts a line break before "Make sure"). Phone: "The SMS code is valid for 5 minutes." on iOS and Android, but "The phone code is valid for 5 minutes. Make sure to check your Spam/Junk folder." on the web.
4. The code field. Web: one field shown as six spaced places (`- - - - -`). iOS: one field. Android: one field of up to 6 characters.
5. "Resend one-time code"; the web adds the countdown in brackets, "Resend one-time code (30)". iOS shows "You can resend a one-time code in 30 seconds." while it counts down; Android shows a timer beside the link.
6. "Log In" on the web; "LOGIN" on iOS and Android.
7. The help line of [Sign in](https://docs.snapfix.com/how-the-apps-work/screens/account/sign-in.md).

A WhatsApp resend ("Didn't receive the code?", "Resend via WhatsApp", "Try SMS Instead") is in the code of all three platforms and switched off: commented out on the web, and behind the same flags as [Forgot password](https://docs.snapfix.com/how-the-apps-work/screens/account/forgot-password.md#dialogs-and-sheets) in the apps.

## Inputs

| Field | Type | Required | Default | Rules and messages                                                                                                                                                                                                                                                                                                                                                                                       |
| ----- | ---- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Code  | Text | Yes      | Empty   | Web: the mask does not check the characters, and "Log In" is enabled once the field is not empty, so a short entry is sent too. iOS: "LOGIN" is on for six characters with no letter, and also for any text with a letter except at seven characters. Android: "LOGIN" is on at six characters. A rejected code shows "This code is not correct, please try again." on iOS and Android, under the field. |

## Actions

| Action                         | Who                         | What happens                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | API                                                                                                                                                                                          |
| ------------------------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Open (web, Android, iOS phone) | The previous screen         | The code was sent before this step opened. The 30-second resend wait starts now.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | -                                                                                                                                                                                            |
| Open (iOS email)               | The previous screen         | No code was sent, and this screen sends none, although the sentence says a code was sent. The resend link is on at once; tapping it sends the first code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | -                                                                                                                                                                                            |
| "Log In" / "LOGIN"             | Anyone with the code        | Checks the code with the reference ID from the send. Web: waits 1.5 seconds, stores the session, runs the IP lookup and opens `/fix`; it does not check for a temporary password. iOS: waits 0.5 seconds, stores the session with an empty password in the device stores, then opens the app, or [Reloading Snapfix](https://docs.snapfix.com/how-the-apps-work/screens/account/download-data.md) for a different user, or [Set password](https://docs.snapfix.com/how-the-apps-work/screens/account/set-password.md) when a password is required. Android: stores the user with an empty password; a temporary password opens [Set password](https://docs.snapfix.com/how-the-apps-work/screens/account/set-password.md); the same user opens the app and a different user [Reloading Snapfix](https://docs.snapfix.com/how-the-apps-work/screens/account/download-data.md); no user shows "Something went wrong. Please try again." A wrong code on the web shows the server's message in an alert and keeps the code. | [`POST /verify-otp`](https://docs.snapfix.com/engineering-reference/api/auth.md) on authpy                                                                                                   |
| "Resend one-time code"         | Anyone, after the countdown | Sends a new code and restarts the 30-second countdown. Web and iOS ask for a new code; the web shows the server's message, or "An message has been sent", in an alert for five seconds. iOS sends `send_via` `sms`, also for email, and shows a failure in an alert. Android resends with `send_via` `na` for email and `sms` for a phone, and shows the server's message as a toast.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Web and iOS: [`POST /login-with-otp`](https://docs.snapfix.com/engineering-reference/api/auth.md). Android: [`POST /resend-otp`](https://docs.snapfix.com/engineering-reference/api/auth.md) |
| Back                           | Anyone                      | Returns to [Forgot password](https://docs.snapfix.com/how-the-apps-work/screens/account/forgot-password.md). On the web the form keeps what was typed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | -                                                                                                                                                                                            |
| "HelpHub."                     | Anyone                      | As on [Sign in](https://docs.snapfix.com/how-the-apps-work/screens/account/sign-in.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | -                                                                                                                                                                                            |

Android also listens for the code SMS: when it arrives, it fills the field and presses "LOGIN".

## States

* **Loading:** web: "Log In" spins and resend shows a spinner; the back arrow is disabled while either runs. iOS: "Refreshing...". Android: "Please wait..." while a code is resent.
* **Empty:** the log-in button is disabled until the code rule in [Inputs](#inputs) passes.
* **Error:** the messages in [Inputs](#inputs) and [Actions](#actions).
* **No permission:** no role check.
* **Offline (mobile):** iOS resend shows "No Connection" and "No internet connection detected. Internet access is required to login." Android checks before resend and verify and shows "You must be connected to the Internet to carry out this task. Please connect and try again." with "OK". Nothing is sent.

## Dialogs and sheets

The alerts and the toast above. No channel choice is shown while WhatsApp codes are off.

## Platform differences

| Topic               | Web                      | iOS                                                                                                                                                                                                     | Android                                |
| ------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| Phone validity line | mentions the spam folder | "The SMS code is valid for 5 minutes."                                                                                                                                                                  | "The SMS code is valid for 5 minutes." |
| Email code on open  | already sent             | not sent                                                                                                                                                                                                | already sent                           |
| Resend              | `POST /login-with-otp`   | `POST /login-with-otp`                                                                                                                                                                                  | `POST /resend-otp`                     |
| Code from the SMS   | no                       | no                                                                                                                                                                                                      | fills the field and signs in           |
| After success       | `/fix`                   | the app, [Reloading Snapfix](https://docs.snapfix.com/how-the-apps-work/screens/account/download-data.md) or [Set password](https://docs.snapfix.com/how-the-apps-work/screens/account/set-password.md) | the same as iOS                        |


---

# 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/forgot-password-code.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.
