express-user-local-basic
Advanced tools
Comparing version 0.0.1-alpha.1 to 0.0.1-alpha.2
@@ -199,2 +199,101 @@ //Copyright (c) 2015 Eric Vallee <eric_vallee2003@yahoo.ca> | ||
ResponseRoutes['NoSessionUser'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="NoSessionUser") | ||
{ | ||
Res.status(401).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['NoAuth'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="NoAuth") | ||
{ | ||
Res.status(401).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['BadField'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="BadField") | ||
{ | ||
Res.status(400).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['NoID'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="NoID") | ||
{ | ||
Res.status(400).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['NoField'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="NoField") | ||
{ | ||
Res.status(400).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['PrivateField'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="PrivateField") | ||
{ | ||
Res.status(401).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['InvalidAuth'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="InvalidAuth") | ||
{ | ||
Res.status(401).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['BadBody'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="BadBody") | ||
{ | ||
Res.status(400).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
ResponseRoutes['NoAuto'] = function(Err, Req, Res, Next) { | ||
if(Err.Type && Err.Type==="NoAuto") | ||
{ | ||
Res.status(400).end(); | ||
} | ||
else | ||
{ | ||
Next(Err); | ||
} | ||
} | ||
module.exports = function(Options) { | ||
@@ -236,4 +335,5 @@ var Roles = Options && Options.Roles ? Options.Roles : {'Edit': ['Admin'], 'Delete': ['Admin'], 'Get': ['Admin']}; | ||
Router.use('/User/Self', ResponseRoutes['UserPatchErr']); | ||
Router.post('/User/:Field/:ID/:SetField', ResponseRoutes.UserPatch(SendEmail)); | ||
Router.use('/User/:Field/:ID/:SetField', ResponseRoutes['UserPatchErr']); | ||
Router.post('/User/:Field/:ID/Recovery/:SetField', ResponseRoutes.UserPatch(SendEmail)); | ||
Router.use('/User/:Field/:ID/Recovery/:SetField', ResponseRoutes['UserPatchErr']); | ||
Router.use('/User/:Field/:ID/Recovery/:SetField', ResponseRoutes['NoAuto']); | ||
Router.put('/User/Self/Memberships/:Membership', ResponseRoutes.UserMembershipsPut); | ||
@@ -272,2 +372,10 @@ Router.use('/User/Self/Memberships/:Membership', ResponseRoutes.UserMembershipsPutErr); | ||
Router.use('/', ResponseRoutes['NotValidatedErr']); | ||
Router.use('/', ResponseRoutes['NoSessionUser']); | ||
Router.use('/', ResponseRoutes['NoAuth']); | ||
Router.use('/', ResponseRoutes['BadField']); | ||
Router.use('/', ResponseRoutes['NoID']); | ||
Router.use('/', ResponseRoutes['NoField']); | ||
Router.use('/', ResponseRoutes['PrivateField']); | ||
Router.use('/', ResponseRoutes['InvalidAuth']); | ||
Router.use('/', ResponseRoutes['BadBody']); | ||
}; | ||
@@ -274,0 +382,0 @@ }; |
{ | ||
"name": "express-user-local-basic", | ||
"version": "0.0.1-alpha.1", | ||
"version": "0.0.1-alpha.2", | ||
"description": "Basic response handler for express-user-local.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -21,1 +21,7 @@ Express-User-Local-Basic | ||
Initial prototype | ||
0.0.1-alpha.2 | ||
------------- | ||
- Updated library to be compatible with route change in the 0.0.1-alpha.15 version of express-user | ||
- Updated library to handle response feedback from version 0.0.1-alpha.12 of express-user-local |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
31384
339
27