Topic: infinite looping in authentication (restful_authentication)

(reposted from

i think this is solved but as it would have saved me time to see this, im posting it nonetheless. 

it may seem like a good idea to include authentication throughout your application and therefore include the following line in your application controller (application.rb)

before_filter :login_required

that line of code requires a skipping of the login requirement when signing up.  otherwise, naturally, there will be an infinite loop:  rails is sending you, as required, to log in but the before filter is requiring you to be logged in before it lets you log in, etc etc..

the way to do that is to put code like the following in the SessionController (session_controller.rb)

skip_before_filter :login_required

lastly, you can add an 'except' clause or an 'only' clause to the before_filter, or the skip_before_filter.  for details, see the API.

all the best..~ari