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

adds logUnauthorized option - addresses #56 #112

Merged
merged 2 commits into from Apr 23, 2018
Merged

adds logUnauthorized option - addresses #56 #112

merged 2 commits into from Apr 23, 2018

Conversation

@spanditcaa
Copy link
Contributor

spanditcaa commented Apr 5, 2018

This adds a logUnauthorized option (default false) which calls request.log(['crumb'], 'validation failed') if enabled, when crumb denies a request.

const preResponse = function (request, h) {

const logs = request.logs;
const found = logs.find((log) => {

This comment has been minimized.

Copy link
@geek

geek Apr 10, 2018

Member

can simplify and assign to logFound directly

const preResponse = function (request, h) {

const logs = request.logs;
const found = logs.find((log) => {

This comment has been minimized.

Copy link
@geek

geek Apr 10, 2018

Member

can simplify and assign to logFound directly

const unauthorizedLogger = () => {

if (settings.logUnauthorized) {
request.log(['crumb'], 'validation failed');

This comment has been minimized.

Copy link
@geek

geek Apr 10, 2018

Member

might be good to add another tag: 'unauthorized' or 'forbidden'

@geek
geek approved these changes Apr 10, 2018
@spanditcaa

This comment has been minimized.

Copy link
Contributor Author

spanditcaa commented Apr 11, 2018

@geek @jonathansamines - merge/release? I'd like to get this into my apps.

@geek

This comment has been minimized.

Copy link
Member

geek commented Apr 11, 2018

@spanditcaa I'll give @jonathansamines another day to raise any concerns. If there aren't any then I'll release this update tomorrow.

@spanditcaa

This comment has been minimized.

Copy link
Contributor Author

spanditcaa commented Apr 16, 2018

@jonathansamines @geek just checking in..

@geek geek added the feature label Apr 23, 2018
@geek geek added this to the 7.1.0 milestone Apr 23, 2018
@geek geek self-assigned this Apr 23, 2018
@geek geek merged commit 2dba524 into master Apr 23, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@geek geek deleted the logUnauthorized branch Apr 23, 2018
@spanditcaa

This comment has been minimized.

Copy link
Contributor Author

spanditcaa commented Apr 23, 2018

Thanks @geek!

@geek

This comment has been minimized.

Copy link
Member

geek commented Apr 23, 2018

Released as 7.1.0 and 6.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.