department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
283 stars 204 forks source link

We ran into an issue with a double render/redirect error on ... #96318

Open platform-support-slack-integration[bot] opened 2 hours ago

platform-support-slack-integration[bot] commented 2 hours ago

Submitted By: noah.stern Topic: Something Else Team: Tier 1 Support

We ran into an issue with a double render/redirect error on one of our Vets-API VYE controllers.

We were able to trace it down to Pundit issuing the render/redirect and we were able to work around it by adding before_action :skip_authorization.

By the time we get to this action in our controller, the user should have already passed authorization checks and we don't think we need to authorize again.

We noticed in several other places, there's skip_authentication, so it looks like maybe this kind of thing is okay?

We're not sure this is the right way to resolve the issue and would like some guidance from a platform architect to review.

platform-support-slack-integration[bot] commented 2 hours ago

Slack Thread Link: https://dsva.slack.com/archives/CBU0KDSB1/p1730480054062129