---
url: "https://vueda.dev/v3/reference/api/js/stores/storeUser/methods/login.md"
title: "login"
---

# login

## Overview

Signs the user in, then refetches the current user.
When the server answers with a pending flow, such as two-factor authentication, the refetch sets `authPendingFlow` and the call resolves instead of rejecting.

## Signature

`login(payload)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-payload">payload</span> | `object` | yes | The credentials to send. |

#### payload Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-payload-email">email</span> | `string` |  |  | The user's email address. |
| <span id="param-payload-password">password</span> | `string` |  |  | The user's password. |

### Returns

`Promise`

Resolves when signed in or a flow is pending; rejects with the request error otherwise.

## Source

`client/lib/stores/storeUser.js:287`
