# Create you first user

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

You can register from\
dashboard  <https://feathersjs-mongoose-casl-admin.herokuapp.com/>  swagger <http://localhost:3030/docs>\
postman

### [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/648e29eb55b4a26be732)

{% embed url="<https://documenter.getpostman.com/view/1210930/S1ZxapVe?version=latest>" %}

###

### Run your server

```
npm run dev
```

## Create user

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

#### Request Body

| Name     | Type   | Description         |
| -------- | ------ | ------------------- |
| password | string | password1234        |
| email    | string | <MyEmail@gmail.com> |

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

```javascript
{
createdAt: "2019-03-07T08:52:32.429Z"
email: "MyEmail@gmail.com"
isVerified: false
roles: []
updatedAt: "2019-03-07T08:52:32.429Z"
verifiedRequired: true
__v: 0
_id: "5c80dbd0e3c6b10ad0375457"
}
```

{% endtab %}
{% endtabs %}

### Postman snippet

```
curl -X POST \
  http://localhost:3030/users \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 5ad6571f-e2dd-4737-b0e5-73d2fe8986fe' \
  -H 'cache-control: no-cache' \
  -d '{
	"email": "yourEmail@gmail.com",
	"password": "password"
}'
```

### Response

```
{
    "roles": [],
    "_id": "5c84204c1fa2991670286a70",
    "email": "doron.nahum@gmail.com",
    "isVerified": false,
    "updatedAt": "2019-03-09T20:21:32.784Z",
    "createdAt": "2019-03-09T20:21:32.784Z",
    "__v": 0,
    "verifiedRequired": true
}
```

### verifiedRequired is true, you can't login to app yet, if you try to login the server will return error with message: "User's email is not yet verified."

### You can try to login to dashboard:

### [mongoose-casl-admin](/feathers-mongoose-casl/docs/start-new-project-1/install-feathers-mongoose-casl.md)

{% hint style="danger" %}

### **Didn't receive any email?**

* Check the spam folder

If you are using mail service without a domain, you need to add you email at mailgun/sendgrid to the whitelist<br>

if you use a free **mailgun** account then you need to verify the emails you want to email Please add your email where you'd like to sign in to your app <https://app.mailgun.com/app/account/authorized>\
\
1- verify that you update a valid mailgun/sendgrid key in the config\default.json\
2- verify that you update the feathers-mongoose-casl.mailer.service to 'sendgrid' or 'mailgun' in the config\default.json\
3- verify that you update a vaild verifyEmail.fromEmail in config\default.json\
4- you can see debug logs by updating logger level to  'debug at, src\logger.js

&#x20;
{% endhint %}

### Want to resend the email?

#### Postman snippet

```
curl -X POST \
  http://localhost:3030/authManagement \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 6f647968-5e41-45a1-8b82-d8ad42dabcda' \
  -H 'cache-control: no-cache' \
  -d '{
   "action": "resendVerifySignup",
   "value": {"email": "YOUR_EMAIL@Gmail.com"}
}'
```


---

# 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://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/docs/start-new-project-1/create-you-first-user.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.
