> For the complete documentation index, see [llms.txt](https://ftcoders.first-tech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ftcoders.first-tech.com/first-tech-ttp-sdk/login-and-authentication.md).

# Login and Authentication

**Objective**

This section defines the **minimum requirements** for the login and **two-factor authentication (2FA)** flow, ensuring secure, clear, and accessible access to the sales environment, based on UX best practices and data protection standards.

Insights

* Authentication structure should be compatible with **offline contexts** (e.g., reconnection handling, secure caching) **where applicable**.
* This flow must comply with security regulations required for proximity-based payments via NFC (e.g., PCI MPoC).&#x20;

***

<figure><img src="https://732834971-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRHBTYHK49B1fSJrGzk2y%2Fuploads%2FKw89wEs5NcKrf7gEiUs1%2FSe%C3%A7%C3%A3o%202%20-%20Autentica%C3%A7%C3%A3o.png?alt=media&amp;token=9ef0a9a4-304b-4568-a4f7-1e3a40f205ac" alt=""><figcaption></figcaption></figure>

## Login Screen with Empty Fields

### 01 - Email and password fields

Must appear empty with clear placeholders (e.g., `example@email.com`, `Password123@`)

{% hint style="success" %}
**Mandatory:**&#x20;

The “Login” button must only be enabled when both fields are correctly completed.
{% endhint %}

{% hint style="info" %}
**Recommended:**&#x20;

Include a “Forgot your password?” link for recovery.
{% endhint %}

***

## Login Screen with Credentials Filled

### 02 - “Login” button (enabled)

Must be visually highlighted. Tapping it initiates sending a verification code to the registered email.

{% hint style="success" %}
**Mandatory:**&#x20;

Provide immediate visual feedback when the button is tapped (e.g., loading animation).
{% endhint %}

{% hint style="info" %}
**Recommended:**&#x20;

Include a confirmation cue (visual or audio) after login attempt.
{% endhint %}

***

## Two-Factor Authentication (2FA) Code Entry

### 03 - Security info message

Must inform the user that a verification code has been sent to their email, partially masked (`us****@email.com`)

### 04 - Code input fields (6 digits)

Must support auto-advance on input and visual feedback per digit.

{% hint style="success" %}
**Mandatory:**&#x20;

Show countdown timer to resend the code (e.g., “Resend code in 00:30”)
{% endhint %}

{% hint style="info" %}
**Recommended:**&#x20;

Automatically validate the code once all digits are entered.
{% endhint %}

***

## Code Fully Entered

### 05 - Complete 2FA code

Must automatically enable the “Login” button once all digits are valid

{% hint style="success" %}
**Mandatory:**&#x20;

After code validation, user must be redirected to the sales environment.
{% endhint %}

{% hint style="info" %}
**Recommended:**&#x20;

Use smooth visual transitions to reinforce successful authentication.
{% endhint %}

***

## Access to Sales Environment

Show the sales home screen. This screen must display:

* Vendor name and photo
* Search bar
* Product list with name, category, price, stock
* Bottom navigation bar with visible sections: Home, Cart, Charge, User&#x20;

{% hint style="success" %}
**Mandatory:**&#x20;

Navigation is only accessible after full credential + code validation.
{% endhint %}

{% hint style="info" %}
**Recommended:**&#x20;

Customize this screen with relevant info based on vendor profile.
{% endhint %}

> **Each component and user experience of the sales screen will be discussed in more detail in the next session.**

***

## Mandatory Messages

* When the code is incorrect:

  > Invalid code. Please check the number sent to your email and try again.
* When the code expires:

  > Code expired. Please request a new one to continue.

***

## Expected Behaviors

* The app must provide **visual and/or audio feedback** at each stage.
* The “Login” button must respect validation logic.
* Two-factor authentication is **mandatory** before accessing the sales system.
* Sensitive data (email, password) must be handled with **masking and encryption**, in accordance with LGPD and PCI standards.


---

# 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://ftcoders.first-tech.com/first-tech-ttp-sdk/login-and-authentication.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.
