feat: Add GET route for sign out on static error pages
Resolves #5101
Description
Adds the ability for users to sign out from error pages (403, 404, 422, 500)
- Add GET route for sign out in devise_scope block in routes
- Add sign_out_error_page method to sessions controller
- Add feature tests for logout on error pages
- Remove data-method="delete" from error pages
Type of change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
How Has This Been Tested?
- Added feature tests that verify users can log out from all error pages
- Tests check that the logout link is present and that clicking it successfully logs the user out
log in as [email protected] then go to http://localhost:3000/500 click on "Log out"
Screenshots
404 error page
422 error page
403 error page
500 error page
LGTM functionally. over to @dorner for technical review, though I do note that the linter failed
LGTM functionally. over to @dorner for technical review, though I do note that the linter failed
Could it be because my branch is not up to date with main?
Maybe? I think I've seen some folk talking about some rubocop weirdness since the update to 3.4 on the slack.
Sorry @Gabe-Torres -- I thought you were going to do the merge of main into your branch! Have done it, and the linter is now passing.
@dorner -- Can you do the technical pass on this, please? Thanks!
Sorry @Gabe-Torres -- I thought you were going to do the merge of main into your branch! Have done it, and the linter is now passing.
@dorner -- Can you do the technical pass on this, please? Thanks!
I thought we were waiting for the code approval before the merge of main. Sorry about that! Thanks @cielf !
@Gabe-Torres We wait for code approval for merge of your branch into main. We can merge the current main into your branch whenever.
I think this is in @dorner's hands for review later this week.
@Gabe-Torres -- Are you still working on this?
Sorry for the super delayed response y'all! I recently started a new position and got a bit busy
... buuuut the tests fail :)
Ok PIVOT! Let's switch to using a form-button for the logout so that it can send a POST+DELETE without needing javascript. Let me know if that makes sense or not.