UserEngine problem with nested controllers


#1

Hi,

I ran into a bit of a problem recently with the UserEngine and nested
controllers. The issue was that it got itself into an endless
redirection loop whenever it tried to take the user to the login screen
from a nested controller, it was trying to redirect to /admin/user/login
instead of /user/login.

To fix the issue I replaced the login redirect in authorized_system.rb
to the following:

redirect_to LoginSystem.config(:app_url) + “/user/login”

This fixed the issue but is there a better way to do this?

Kev


#2

if you have something like this in environment.rb:

module LoginEngine
config :login_page, {:controller => ‘/user’, :action => ‘login’}
end

… then the UserEngine should respect that.

HTH

  • james

#3

I do have this but it makes no difference, it still tries to redirect
relative to the base controller (admin in this case). Redirects from
controllers that aren’t nested work fine.

It’s a bit of an odd one, I think it may be related to Rails iteself
rather than the UserEngine but I don’t know enough about Rails just yet
to know where to start with debugging, or even if links/redirects work
differently from within nested controllers.

Kev


#4

When creating links, a forward slash in front of the controller
normally ensures that it links to controllers at the top level,
outside of any module nesting… what you describe seems very odd! Can
you work up a minimal test case, and send it along with details of
your environment?

  • james