Cleaned up remember-me error handling.
This commit is contained in:
parent
bc0657a702
commit
d874f5e2da
|
|
@ -64,8 +64,8 @@ module.exports.errorHandler = function(res, msg, type = "Generic", status = 400)
|
||||||
* @param {Error} err - Exception to handle
|
* @param {Error} err - Exception to handle
|
||||||
*/
|
*/
|
||||||
module.exports.localExceptionHandler = function(err){
|
module.exports.localExceptionHandler = function(err){
|
||||||
//If we're being verbose
|
//If we're being verbose and this isn't just a basic bitch
|
||||||
if(config.verbose){
|
if(!err.custom && config.verbose){
|
||||||
//Log the error
|
//Log the error
|
||||||
module.exports.dumpError(err);
|
module.exports.dumpError(err);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -242,8 +242,11 @@ module.exports.rememberMeMiddleware = function(req, res, next){
|
||||||
res.clearCookie('rememberme.id');
|
res.clearCookie('rememberme.id');
|
||||||
res.clearCookie('rememberme.token');
|
res.clearCookie('rememberme.token');
|
||||||
|
|
||||||
//Bitch, Moan, and guess what? That's fuckin' right! COMPLAIN!!!!
|
//Quietly handle exceptions without pestering the user
|
||||||
return loggerUtils.exceptionHandler(res, err);
|
loggerUtils.localExceptionHandler(err);
|
||||||
|
|
||||||
|
//Go on with life
|
||||||
|
next();
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
//Jump to next middleware, this looks gross but it's only because they made me use .then like a bunch of fucking dicks
|
//Jump to next middleware, this looks gross but it's only because they made me use .then like a bunch of fucking dicks
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue