fix(rails-security): exempt the session actions from verify_authorized

- SessionsController inherits ApplicationController's after_action
  :verify_authorized but never calls authorize, so sign-in and sign-out raised
  Pundit::AuthorizationNotPerformedError after running instead of redirecting
- Shows the explicit skip_after_action beside the callback that needs it
This commit is contained in:
Rockwell Windsor Rice committed 2026-11-08 16:38:53 -06:00
1 parent 287d4c44bf
commit 92a2328e91
2 files changed
+6 -1

No files matched your search

@@ -10,7 +10,7 @@
"id": "hand-seeded",
"source": "manual-curation-pending-regeneration"
},
"registryDigest": "693ffc2f5995992658804b3bd0437f9d4d3d015b7bfe138759800612ac976b8a",
"registryDigest": "2ccff61a9807b0d0ca0a75ce73149e5f66faa74e24319b97d2068b7ec5071451",
"schemaVersion": 1,
"triggers": {
"skill:agent-runtime-gateway-smoke-test": [
+5
View File
@@ -158,6 +158,11 @@ class ApplicationController < ActionController::Base
after_action :verify_authorized, except: :index
after_action :verify_policy_scoped, only: :index
end
# Public actions have no record to authorize, so exempt them explicitly.
class SessionsController < ApplicationController
skip_after_action :verify_authorized
end
```
## Strong Parameters and Mass Assignment