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 your server
npm run dev
Create user
POST
http://localhost:3030/users
Request Body
password
string
password1234
string
MyEmail@gmail.com
{
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"
}
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:
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
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
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"}
}'
Last updated
Was this helpful?