devise icon indicating copy to clipboard operation
devise copied to clipboard

authenticate_user! inside ApplicationController causes infinite redirect

Open rogercampos opened this issue 15 years ago • 8 comments

Hi, I've been using devise on the edge, with :authenticate_user! inside my application_controller without a problem. Now however, this issues an infinite redirect.

It works fine if I add a conditional to check if it's a devise_controller, as I've seen in this thread

before_filter :authenticate_user!, :unless => :devise_controller?

But I suppose it should work without that.

rogercampos avatar Jan 17 '11 08:01 rogercampos

Which commit on edge? This was supposed to be fixed on latest commits.

josevalim avatar Jan 17 '11 08:01 josevalim

The last one,

  • remote: git://github.com/plataformatec/devise.git
  • revision: 971f68f97d472d4b3b9244594b85759ddf76d1ca

rogercampos avatar Jan 17 '11 08:01 rogercampos

Hrm, ok. Can you then please reproduce it in a smaller application and push it to Github? Thanks!

josevalim avatar Jan 17 '11 09:01 josevalim

Here it is https://github.com/rogercampos/devise_787_test

rogercampos avatar Jan 17 '11 10:01 rogercampos

I think I have it on the same problem. Check out #795 where I show a sample app and describe how I think it's related to #720.

I tried the fix above (adding :unless => :devise_controller? to the before filter), and that does make the infinite redirect go away.

zippy avatar Jan 20 '11 01:01 zippy

Fix infinite redirect issues. Closed by 0615c0a0a49b3b28a8bf755924771e3c49498484 and Closed by 0615c0a0a49b3b28a8bf755924771e3c49498484.

josevalim avatar Jan 20 '11 08:01 josevalim

I have use gem version 1.2rc but bug sill exist in production with rails 3.0.3 Maybe men need to update ??

bublik avatar Feb 02 '11 16:02 bublik

I experienced the same issue on production in v1.1.8 and temporarily fixed it by setting config.cache_classes = false . Now I'm on v1.2.rc2 and do not see redirects anymore. (rails 3.0.5)

TatianaTyu avatar Mar 17 '11 10:03 TatianaTyu