Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to the newer virtuals plugin #11

Merged
merged 4 commits into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function signIn (email, password) {
## Notes

* BCrypt requires that passwords are 72 characters maximum (it ignores characters after 72).
* This library enables the built-in `virtuals` plugin on Bookshelf for the virtual `password` field.
* This library enables the `bookshelf-virtuals-plugin` plugin on Bookshelf for the virtual `password` field.
* Passing a `null` value to the password will clear the `password_digest`.
* Passing `undefined` or a zero-length string to the password will leave the `password_digest` as-is

Expand Down
2 changes: 1 addition & 1 deletion lib/secure-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function enableSecurePasswordPlugin (Bookshelf) {
/**
* Enable the `virtuals` plugin to prevent `password` from leaking
*/
Bookshelf.plugin('virtuals')
Bookshelf.plugin('bookshelf-virtuals-plugin')

/**
* Get the password field from the plugin configuration. defaults to `password_digest`
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"mocha": "^6.2.0",
"mock-knex": "^0.4.6",
"nyc": "^14.1.1",
"standard": "^13.1.0"
"standard": "^13.1.0",
"bookshelf-virtuals-plugin": "^0.1.1"
}
}