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

Customizing 401 HTML code #61

Closed
MocanuMarius opened this issue May 13, 2016 · 3 comments
Closed

Customizing 401 HTML code #61

MocanuMarius opened this issue May 13, 2016 · 3 comments

Comments

@MocanuMarius
Copy link

Hey, is there any way we can possibly customize the error response in case of an error ? Instead of "Unauthorized" , i need to use this with swagger and integrate the default swagger error code but i have no way of doing it.

@MocanuMarius MocanuMarius changed the title Customizing HTML code Customizing 401 HTML code May 13, 2016
@sdotson
Copy link

sdotson commented Jul 22, 2016

Correct me if I'm mistaken, but I think you can define the status code in the response of your node application, e.g., res.status(401) if you're using express.

@ebaghern
Copy link

@sdotson You'll need to create a custom callback/middleware for this. Check out: http://passportjs.org/docs/authenticate under custom callback.

@mikenicholson
Copy link
Owner

@MocanuMarius I think what @ebaghern provided should answer your question. Let me know if not and we can reopen 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

4 participants