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

Middleware to check if account is active/verified/blocked etc. #138

Open
gtd57 opened this issue May 4, 2015 · 0 comments
Open

Middleware to check if account is active/verified/blocked etc. #138

gtd57 opened this issue May 4, 2015 · 0 comments

Comments

@gtd57
Copy link

gtd57 commented May 4, 2015

Hi There,
Is there any way to put a middleware in restify object of routes.js file to check whether the User is Verified/Active, up on middleware fail api calls might return 400 bad request saying "Account need to be Verified/Active to do this action".

My wired thought is like, passing the list of middlewares before routing.
Example.
restify.user ('/api/test/user', [LIST_OF_MIDDLEWARES], c.api.test, ['list', 'get']);

The reason behind this is, I need to get the support of Restify.prototype._sendError for output json object.
If I am thinking wrong, can you please tell me the appropriate way of doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant