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 docs for rejections with server responses #2141

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

marcoow
Copy link
Member

@marcoow marcoow commented Mar 19, 2020

When fixing error handling in the dummy app (see #2138), I realized that the reponse the OAuth2 Password Grant authenticator rejects with when authentication fails, has its body read by the authenticator already which means the body cannot be read again in the error handling code. In order to read the body again, the response has to be cloned first.

While we could do the cloning in the authenticators so that the error handling code would not have to worry about that, that could be wasteful in cases where the error handling code only needs access to e.g. the response headers. While we might still do that in the future, this for now adds some info to the docs.

All of the above also applies to the Devise authenticator which also rejects with the server response when authentication fails.

@marcoow marcoow merged commit 55fd053 into master Mar 19, 2020
@delete-merged-branch delete-merged-branch bot deleted the add-docs-for-response-rejection branch March 19, 2020 12:59
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.

2 participants