multicolour-hapi-jwt
Advanced tools
Comparing version 0.1.1 to 0.1.2
11
index.js
"use strict" | ||
const Joi = require("joi") | ||
const boom = require("boom") | ||
@@ -106,7 +107,7 @@ /** | ||
if (err) { | ||
get_decorator_for_apply_value(reply, method)(err, models.multicolour_user) | ||
reply(boom.wrap(err)) | ||
} | ||
// Check a user for that email exists and the passwords match. | ||
else if (!user) { | ||
get_decorator_for_apply_value(reply, method)(new Error("Invalid login."), models.multicolour_user).code(403) | ||
reply(boom.unauthorized("Invalid login.")) | ||
} | ||
@@ -118,3 +119,3 @@ // We're good to create a session. | ||
if (user.password !== hashed_password) { | ||
return get_decorator_for_apply_value(reply, method)(new Error("Invalid login."), models.multicolour_user).code(403) | ||
return reply(boom.unauthorized("Invalid login.")) | ||
} | ||
@@ -137,6 +138,6 @@ | ||
if (err) { | ||
get_decorator_for_apply_value(reply, method)(err, models.session) | ||
reply(boom.unauthorized("Invalid login.")) | ||
} | ||
else { | ||
get_decorator_for_apply_value(reply, method)(session, models.session).code(202) | ||
get_decorator_for_apply_value(reply, method)(session, models.session) | ||
} | ||
@@ -143,0 +144,0 @@ }) |
{ | ||
"name": "multicolour-hapi-jwt", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "JWT Auth plugin for HapiJS Multicolour", | ||
@@ -33,2 +33,3 @@ "main": "index.js", | ||
"istanbul": "^0.3.22", | ||
"multicolour": "^0.4.3", | ||
"nodemon": "^1.7.1", | ||
@@ -39,2 +40,3 @@ "tap-spec": "^4.1.0", | ||
"dependencies": { | ||
"boom": "^4.0.0", | ||
"hapi-auth-jwt2": "^5.8.0", | ||
@@ -41,0 +43,0 @@ "joi": "^8.0.5", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
306
12477
4
6
+ Addedboom@^4.0.0
+ Addedboom@4.3.1(transitive)