> 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="/files/vD2qfcOkIxOH3Bk1VWIp" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ftcoders.first-tech.com/first-tech-ttp-sdk/login-and-authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
