> For the complete documentation index, see [llms.txt](https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/docs/start-new-project-1/test-login.md).

# Test Login

### In this step we are going to login your first user

You can You can login from\
dashboard  <https://feathersjs-mongoose-casl-admin.herokuapp.com/>  swagger <http://localhost:3030/docs>\
postman [feathers-mongoose-casl postman documentation](https://documenter.getpostman.com/view/1210930/S11RJv5r) <br>

<mark style="color:green;">`POST`</mark> `http://localhost:3030/authentication \`

#### Request Body

| Name     | Type   | Description         |
| -------- | ------ | ------------------- |
| password | string | password1324        |
| email    | string | <myEmail@gmail.com> |
| strategy | string | local               |

{% tabs %}
{% tab title="200 " %}

```
{
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9.eyJ1c2VySWQiOiI1YzVhY2MzNzZmMzJhZTNiMDhlNTBhN2EiLCJpYXQiOjE1NDk0NTQ4MzcsImV4cCI6MTU0OTU0MTIzNywiYXVkIjoiaHR0cHM6Ly95b3VyZG9tYWluLmNvbSIsImlzcyI6ImZlYXRoZXJzIiwic3ViIjoiYW5vbnltb3VzIiwianRpIjoiZTI4NTcyNDUtZWMzZi00YzhlLWFiZmUtNzhiMzJhYjlhOGRmIn0.LfSttwrbpjD15bmf9xFtBkid2FcpRJM2YFO6yvosuXI",
    "user": {
        "_id": "5c5acc376f32ae3b08e50a7a",
        "email": "MyEmail@gmail.com",
        "updatedAt": "2019-02-06T12:00:18.441Z",
        "createdAt": "2019-02-06T11:59:51.471Z",
        "__v": 0
    }
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "name": "BadRequest",
    "message": "User's email is not yet verified.",
    "code": 400,
    "className": "bad-request",
    "errors": {}
}
```

{% endtab %}
{% endtabs %}

### Postman snippet

```
curl -X POST \
  http://localhost:3030/authentication \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Postman-Token: eccaf293-a50e-48ec-a53e-aebc241defba' \
  -H 'cache-control: no-cache' \
  -d 'email=doron.nahum%2B11%40gmail.com&password=password&strategy=local&undefined='

```

{% hint style="danger" %}
If you didn't verify your email, the login will fail

### Verify email:

In your inbox you can find mail to verify the email.

the mail come from <yourCompanyEmail@gmail.com>\
you can edit this email from config file, and you can custom the email from src/email-templates/account/verify-email.pug

![](https://1499183940-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LY13uPlo20E7hNPj1d2%2F-L_Z6NjmAxCm8ySORC3Q%2F-L_Z8MbcSRuuVE4YpIb3%2FScreen%20Shot%202019-03-09%20at%2022.28.59.png?alt=media\&token=c149e7b5-38dc-440b-9b71-a0d62abe0ffc)
{% endhint %}
