feathers-mongoose-casl
Version 2.1.2
Version 2.1.2
  • feathers-mongoose-casl
  • Docs
    • Migrating
    • START A NEW PROJECT
      • Generate a new project.
      • install feathers-mongoose-casl
      • feathers-logger
      • Update config
      • Add mongoose
      • Email service
      • App hooks
      • Import required services
      • Verify user and filter user fields
      • Swagger, Logger, BodyParser
      • Email templates
      • public HTML
      • Run the server
      • Create you first user
      • vs code snippet extension
      • Test Login
      • Dashboard
      • Create a new Service with casl&Dashboard
      • Posts Postman snippet
      • Add Admin role
      • Done!
    • Advanced
      • Security - eslint-plugin-security
      • Security - rate limiting
      • Development tools
    • Guides
      • Throw errors
      • Auth Flow
      • Authentication
      • Authouriztion
      • /me
      • Rules Cache
      • Create a new service
      • Custom service validtor client data
      • validators
        • Example of use
        • Types
        • Mongoose schema
      • Default value
      • $Populate
      • Upload service
      • Upload files
        • Create upload service
        • Sign File After Populate
        • Storage support
          • Google-cloud
      • Error
      • feathers Client examples
      • Dashboard
        • Dashboard Config
          • Field configuration
          • doc Layout
          • custom Fields
            • customElements
        • Online dashboard
        • Add to your react app
      • customized feathers-mongoose-casl/services
      • Redis - in progress
      • S3
      • Postman
      • Swagger
      • debug
    • Production
      • ENV
    • Feathers wiki
      • Good links
    • utils
      • send email example
      • Async For Each
      • Create heroku server
      • pick
      • vs code snippet extension
      • Persist user request
    • Ecosystem
    • TODO
    • Versions updates
Powered by GitBook
On this page
  • In this step we are going to register your first user
  • Run your server
  • Create user
  • Postman snippet
  • Response
  • 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
  • Want to resend the email?

Was this helpful?

  1. Docs
  2. START A NEW PROJECT

Create you first user

PreviousRun the serverNextvs code snippet extension

Last updated 5 years ago

Was this helpful?

In this step we are going to register your first user

You can register from dashboard swagger postman

Run your server

npm run dev

Create user

POST http://localhost:3030/users

Request Body

Name
Type
Description

password

string

password1234

email

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

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"}
}'

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 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

mongoose-casl-admin
https://app.mailgun.com/app/account/authorized
https://feathersjs-mongoose-casl-admin.herokuapp.com/
http://localhost:3030/docs
Run in Postman
feathers-mongoose-casl apifeathers-mongoose-casl api
Logo