- session[:referer] = safe_referer(params[:referer]) if params[:referer]
- password_authentication(params[:username].strip, params[:password])
+
+ referer = safe_referer(params[:referer]) if params[:referer]
+
+ password_authentication(params[:username].strip, params[:password], referer)