Strip return to path

This commit is contained in:
Martin Lensment 2015-03-23 16:50:53 +02:00
parent 5f2e0619e5
commit d94d50a174
2 changed files with 4 additions and 11 deletions

View file

@ -16,18 +16,12 @@ class ApplicationController < ActionController::Base
end end
def after_sign_in_path_for(_resource) def after_sign_in_path_for(_resource)
if session[:user_return_to] rt = session[:user_return_to].to_s.presence
return session[:user_return_to].to_s return session[:user_return_to].to_s if rt && rt != admin_login_path
end admin_dashboard_path
if request.path.match('registrar')
registrar_invoices_path
elsif request.path.match('admin')
admin_dashboard_path
end
end end
def after_sign_out_path_for(_resource) def after_sign_out_path_for(_resource)
if request.path.match('registrar') if request.path.match('registrar')
registrar_login_path registrar_login_path
elsif request.path.match('admin') elsif request.path.match('admin')

View file

@ -11,7 +11,6 @@ class Registrar::SessionsController < SessionsController
end end
def login def login
end end
def login_mid def login_mid