Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix back url handling #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/redmine_openid_connect/application_controller_patch.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
module RedmineOpenidConnect
module ApplicationControllerPatch
def require_login
return super unless (OicSession.enabled? && !OicSession.login_selector?)

if !User.current.logged?
if !User.current.logged? && OicSession.enabled? && OicSession.login_selector?
if request.get?
url = request.original_url
else
url = url_for(:controller => params[:controller], :action => params[:action], :id => params[:id], :project_id => params[:project_id])
end
session[:remember_url] = url
end
return super unless (OicSession.enabled? && !OicSession.login_selector?)

if !User.current.logged?
redirect_to oic_login_url
return false
end
Expand Down