app/controllers/fiona7/sessions_controller.rb in infopark_fiona7-1.5.5.5.1 vs app/controllers/fiona7/sessions_controller.rb in infopark_fiona7-1.6.1.1.0

- old
+ new

@@ -5,11 +5,11 @@ def create login, password = params[:login], params[:password] if valid_credentials?(login, password) rsession.user_name = login - redirect_to true_root_path + redirect_to login_redirect else flash[:error] = I18n.t(:"fiona7.invalid_credentails") begin redirect_to :back rescue ActionController::RedirectBackError @@ -18,15 +18,23 @@ end end def destroy rsession.destroy - redirect_to true_root_path + begin + redirect_to :back + rescue ActionController::RedirectBackError + redirect_to true_root_path + end end protected def load_login_page @login_page = Fiona7LoginPage.instance || Scrivito::BasicObj.root + end + + def login_redirect + session[:login_redirect].presence || true_root_path end def true_root_path if Fiona7.mode == :standalone '/'