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

Add option for redirect override in authenticate call #122

Closed
wants to merge 2 commits into from
Closed

Add option for redirect override in authenticate call #122

wants to merge 2 commits into from

Conversation

danielcorin
Copy link

No description provided.

@jaredhanson
Copy link
Owner

Can you describe the use case here? How would the override operate in a way different than the standard redirect?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 733cbed on danielcorin:dc/auth-redirect-option into 1ac8cbb on jaredhanson:master.

@danielcorin
Copy link
Author

We're seeking to expose the status variable configuration which exists in the core passport library here but is no longer exposed in this library. I believe this change would preserve the passport library's original behavior described in the comment.

Redirect to `url` with optional `status`, defaulting to 302.

Our use case is that we'd like to use passport and passport-oauth2 to construct the URL of our external authentication server and return it as a Location header, but don't actually want it to instruct the browser to redirect.

@jaredhanson
Copy link
Owner

My suggestion would be to add a statusCode option, something like:

passport.authenticate({ statusCode: 303});

Seems more readable that passing a function that takes the strategy itself as an argument. And I can't think of any use cases where something other than the status code would be changed on redirect.

@danielcorin
Copy link
Author

danielcorin commented Mar 30, 2020

That sounds reasonable to me. Let me author a new PR and I will close this one out once I do. Thanks for the feedback!

@danielcorin
Copy link
Author

Closing in favor of #123

@danielcorin danielcorin deleted the dc/auth-redirect-option branch March 30, 2020 21:14
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

Successfully merging this pull request may close these issues.

None yet

3 participants