1.6.0-beta.1 • Published 9 years ago

bentojs-api-user v1.6.0-beta.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

npm version GitHub license

Bento API User

Setup

# Install npm package
$ npm install bentojs-api-user --save

Hooks

Store Before

Optional

Executes before a user is registered, enables the system to alter client registration data. If this hook is defined remember to encrypt the payload password.

hooks.set('user:store.before', function *(payload, _user) {
 /*
  payload : The data payload provided by the client.
  _user   : The authenticated user making the request if present.
 */
 return payload;
});

Store After

Optional

Executes after a successfull user registration.

hooks.set('user:store.after', function *(user, _user) {
 /*
  user  : The newly registered users system data.
  _user : The authenticated user that made the registration request.
 */
});

Save Before

Optional

Executes before a user is saved, enables the system to alter client update data. If this hook is defined remember to encrypt the payload password.

hooks.set('user:save.before', function *(payload, _user) {
 /*
  payload : The data payload provided by the client.
  _user   : The authenticated user making the request if present.
 */
 return payload;
});

Save After

Optional

Executes after a successfull user update.

hooks.set('user:save.after', function *(user, _user) {
 /*
  user  : The updated user.
  _user : The authenticated user that made the registration request.
 */
});

Delete Before

Optional

Executes before a user is deleted.

hooks.set('user:delete.before', function *(payload, _user) {
 /*
  user  : The payload provided by the client.
  _user : The authenticated user that made the registration request.
 */
});

Verification

Required

This is a required hook run when a verification request is being processed. If a error is thrown during this hook the verification event is cancelled and can be retried.

hooks.set('user:verification', function *(user, token, result) {
 /*
  user   : The user being verified.
  token  : The verification token.
  result : The data connected to the token, this contains [ 'id', 'type' ].
 */
});

#### [Password Token](#password-token)

_Required_

This is a required hook and is provided by default on a fresh install (from version 1.3.8). It is executed when a new password reset token has been provided.

```js
hooks.set('user:password-token', function *(user, resetUri) {
 /*
  user     : The user account that is request a password reset.
  resetUri : The full uri to executed to take the client directly to the password reset window.
 */
});
1.6.0-beta.1

9 years ago

1.3.8

9 years ago

1.3.7

9 years ago

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.15

9 years ago

1.1.14

9 years ago

1.1.13

9 years ago

1.1.12

9 years ago

1.1.11

9 years ago

1.1.10

9 years ago

1.1.9

10 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.3.19

10 years ago

0.3.18

10 years ago

0.3.17

10 years ago

0.3.16

10 years ago

0.3.15

10 years ago

0.3.14

10 years ago

0.3.13

10 years ago

0.3.12

10 years ago

0.3.11

10 years ago

0.3.10

10 years ago

0.3.9

10 years ago

0.3.8

10 years ago