-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs for error response in the form_post and error view
Bug When an error is rendered with the `form_post.html.erb` view, an empty form is posted instead of the correct error and error_description. Root cause The form_post view used the body of `@authorize_response`. However, the `redirect_or_render` could be called with `authorization.deny` or `pre_auth.error_response`. In this case, `@authorize_response` would only contain an empty body. Fix Instead of using `@authorize_response`, we pass in a local variable `auth` to the `form_post.html.erb`, which corresponding to the auth object passed into the redirect_or_render function. Tests are backfilled to the authorizations controller spec. During the test phase, I discovered error.html.erb always renders an incorrect error description. It turns out that `respond_to(:error_respon se)` always return false in the view. I changed it to use `local_assigns` as the correct condition.
- Loading branch information
Showing
4 changed files
with
137 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters