Go directly to "My page" after login

Added by David Strejc over 11 years ago

Please,

can anybody skilled in RoR and redmine help me with little issue?

I would like to be redirected directly to "My page" after login - not to
index page. I've went through code myself but for now it is a little bit
hardcore for me.

Thanks a lot for any advice.

Replies (6)

RE: Go directly to "My page" after login - Added by Felix Kokocinski over 11 years ago

Hi David

as I understand it, you can decide where to take the user in the /app/controllers/account_controller.rb login function.
This will usually point to the "my page":
redirect_back_or_default :controller => 'my', :action => 'page'
but you should be able to enforce it like this:
redirect_to :controller => 'my', :action => 'page'

RE: Go directly to "My page" after login - Added by David Strejc over 11 years ago

Thanks a lot for your reply - I found that line in code before and I was disapointed,
because the first hint you wrote is there by default (so I was missing something).

But when I've changed redirect_back_or_default function to yours redirect_to it started
to work. So maybe I don't understand redirect_back_or_default function well as I don't
understand RoR for now.

But anyway thanks for your help.

Many thanks.

David

RE: Go directly to "My page" after login - Added by Keith Cascio over 11 years ago

Thank you Felix, this information helped me a lot.

RE: Go directly to "My page" after login - Added by Rupesh Helwade over 5 years ago

This seems to be quite old, breaks the Lost Password page.

Perhaps we need to change : /config/routes.rb
RedmineApp::Application.routes.draw do
root :to => 'welcome#index', :as => 'home'

Here we may have to change the route to appropriate.

I am using 2.3.1 stable version and possibly the code might have changed already.

RE: Go directly to "My page" after login - Added by Aleksandar Pavic 4 months ago

Changing routes creates various issues, like when sending test email from backend, or when trying to export issues as atom...

RE: Go directly to "My page" after login - Added by Emmanuel DUMAS about 1 month ago

Just a tips :
to go directly to "My Page" after login, I have bookmark "redmine.org/my/page" instead of just "redmine.org". If I am not connected, it's automatically go to login page, and then to "my page".
Globally, I seem to go directly to "my page".

Best regards

(1-6/6)