human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

feat: Add GET route for sign out on static error pages

Open Gabe-Torres opened this issue 7 months ago • 11 comments

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

404_html_after

422 error page

422_html_after

403 error page

403_html_after

500 error page

500_html_after

Gabe-Torres avatar May 09 '25 01:05 Gabe-Torres

LGTM functionally. over to @dorner for technical review, though I do note that the linter failed

cielf avatar May 09 '25 23:05 cielf

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?

Gabe-Torres avatar May 10 '25 02:05 Gabe-Torres

Maybe? I think I've seen some folk talking about some rubocop weirdness since the update to 3.4 on the slack.

cielf avatar May 11 '25 02:05 cielf

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!

cielf avatar May 25 '25 15:05 cielf

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 avatar May 27 '25 04:05 Gabe-Torres

@Gabe-Torres We wait for code approval for merge of your branch into main. We can merge the current main into your branch whenever.

cielf avatar May 27 '25 14:05 cielf

I think this is in @dorner's hands for review later this week.

cielf avatar Jun 09 '25 17:06 cielf

@Gabe-Torres -- Are you still working on this?

cielf avatar Jul 03 '25 02:07 cielf

Sorry for the super delayed response y'all! I recently started a new position and got a bit busy

Gabe-Torres avatar Jul 10 '25 23:07 Gabe-Torres

... buuuut the tests fail :)

awwaiid avatar Aug 17 '25 16:08 awwaiid

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.

awwaiid avatar Aug 24 '25 14:08 awwaiid