On 5 Nov 2008, at 04:41, Clem Rock wrote:
>
> For some reason, when I login the last request.request_uri address  
> that
> is stored in the session is /login.     For some reason, the
> store_location method is still getting called when the login method is
> called and then throws a "Redirect Loop" message in the brower
>
> Here's the authentication module code:
> [code]
> module Authentication
>  def store_location
>    session['return-to'] = request.request_uri
>  end
>
>  def login
>    user = User.find_authenticated_user(params[:username],
> params[:password])
>    unless user.blank? || user.nil?
>      session[:user] = user
>    end
>    redirect_to store_location
>  end
> end
>
store_location is getting called because you're calling it from the  
login method :-) You probably meant to do redirect_to session['return- 
to'] (possibly checking whether session['return-to'] is nil and  
redirecting the user to some where appropriate if that is the case


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to