stimulusreflex / stimulus_reflex

Build reactive applications with the Rails tooling you already know and love.
https://docs.stimulusreflex.com
MIT License
2.28k stars 172 forks source link

SR cannot re-render authenticated devise routes #104

Closed leastbad closed 4 years ago

leastbad commented 4 years ago

Failed to re-render URL undefined method 'authenticate' for nil:NilClass

Also reports of issues with the validated? method.

To Reproduce

Attempt to use SR on a URL that is access-controlled by an authenticated route:

# routes.rb
authenticated :user, lambda { |u| u.has_role? :admin } do
  get "doh", to: "home#doh"
end

Expected behavior

SR should be able to work with devise authenticated routes.

Screenshots or reproduction

https://docs.stimulusreflex.com/setup#devise

Versions

StimulusReflex

External tools

leastbad commented 4 years ago

I would support closing this now, once 2.1.6 is cut. :fireworks: