Forum: Ruby on Rails Acts as Authenticated Multiple login screens

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Valehru (Guest)
on 2007-05-18 00:13
(Received via mailing list)
I have need to display two distinguishing types of information on the
login.rhtml view, one for a hunter and the other for a recruiter.  The
are both based on the same user model that acts as authenticated has
created.

Each of the methods hunter/index and recruiter/index redirect me to
account/login when I need to login to the system.  I need a way to
find out from what the controller was before it hit the account/login
redirect, either it was recruiter or hunter.

Is there a way of doing getting the name of the controller before that
redirect and accessing it from the account/login view?
Valehru (Guest)
on 2007-05-18 00:16
(Received via mailing list)
Look at it as there are two partial views to be rendered with the
login screen.  Either hunter or recruiter partial depending on which
link was clicked before the redirect to /account/login.  I need a way
of finding out that controller name....
Angel (Guest)
on 2007-05-18 00:50
(Received via mailing list)
On May 17, 4:12 pm, Valehru <removed_email_address@domain.invalid> wrote:
> I have need to display two distinguishing types of information on the
> login.rhtml view, one for a hunter and the other for a recruiter.  The
> are both based on the same user model that acts as authenticated has
> created.
>
> Each of the methods hunter/index and recruiter/index redirect me to
> account/login when I need to login to the system.  I need a way to
> find out from what the controller was before it hit the account/login
> redirect, either it was recruiter or hunter.

The session contains the originating request URL in
session[:return_to]. It's messy, but you could parse the
route and figure out the component from there.

Or you could change lib/authenticated_system.rb to provide a more
elegant workflow for click-thru tracking.
-angel
unknown (Guest)
on 2007-05-18 22:38
(Received via mailing list)
Or you could simply create two login actions and link to whichever one
is appropriate
This topic is locked and can not be replied to.