# Login

The login is a function in the [users](/apphive-documentacion/reference/funciones/users.md) functions which allows to the users access to the app by identifying and authenticating themselves. The users typically fill forms with a "username and a matching "password".

![](/files/-M-k1DVET_ksX8cOExav)

### 📥 Entry vars <a href="#entry-vars" id="entry-vars"></a>

* **Email:** select a text field to provide a way for the user to set his email.
* **Password:** select a text field to provide a way for the user to set his password.

### ↗ Callbacks <a href="#entry-vars" id="entry-vars"></a>

* **Error login:** you can set functions after the user can't login for a database or app problem.
* **Invalid credentials:** you can set functions after the user can't login because his email or password aren't correct.
* **Successful login:** you can set functions after the user can verify with the app database.

### 👉 Example. <a href="#examples" id="examples"></a>

![](/files/-M3DQQ2q0wxFEs4ayN_6)

1. Select the login button and add on press.
2. Add a [toggle page loading](/apphive-documentacion/reference/funciones/elements/toggle-page-loading.md) function and activate only enable.
3. Activate a login function.
4. Select the element to input the email and password.
5. Open the callbacks of the login function and add a toggle page loading on the successful login with and activate the only disable.
6. Add a replace screen and select a screen on the successful login.

![](/files/-M2-n72VrPDqNDR11zLW)


---

# Agent Instructions: 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:

```
GET https://docs.apphive.io/apphive-documentacion/reference/funciones/users/login.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
