2.0.4 • Published 6 years ago

hapi-users-plugin v2.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

hapi-users-plugin (WIP)

HAPI plugin for users and login.

Install

npm i hapi-users-plugin --save

Endpoints

All endpoints, except /authenticate requires that Authorization is set in headers with valid JWT

  • POST /api/users/authenticate
    • Default payload:
      • username - Joi.string().required()
      • password - Joi.string().required()
    • Response if valid login:
      • Body:
        • loggedin - true
      • Headers:
        • authorization - Signed JWT to use
  • GET/POST /api/users/unauthenticate
  • PUT /api/users
    • Default payload:
      • id - Joi.objectId()
      • username - Joi.string()
      • password - Joi.string()
      • admin - Joi.boolean()
    • Response if editing own user:
      • Headers:
        • authorization - Updated and signed JWT to use.
  • DELETE /api/users
    • Default payload:
      • id - Joi.objectId().required()
  • POST /api/users
    • Default payload:
      • username - Joi.string().required()
      • password - Joi.string().required()
      • admin - Joi.boolean().default(false)
  • GET /api/users
    • Optional parameters:
      • from - Joi.objectId() - From which userid the list shall begin (omitting fromId)
      • limit - Joi.number() - Total of users to get
    • Default response:
      • Array with all users, passwordhash omitted
  • GET /api/users/{username}
    • Default response:
      • Object with user, passwordhash omitted
2.0.4

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago