Add more SSO logging for failure conditions
This commit is contained in:
parent
953ac7de8f
commit
d3b24b625b
|
@ -43,15 +43,25 @@ class SessionController < ApplicationController
|
||||||
return_path = sso.return_path
|
return_path = sso.return_path
|
||||||
sso.expire_nonce!
|
sso.expire_nonce!
|
||||||
|
|
||||||
if user = sso.lookup_or_create_user
|
begin
|
||||||
if SiteSetting.must_approve_users? && !user.approved?
|
if user = sso.lookup_or_create_user
|
||||||
# TODO: need an awaiting approval message here
|
if SiteSetting.must_approve_users? && !user.approved?
|
||||||
|
# TODO: need an awaiting approval message here
|
||||||
|
else
|
||||||
|
log_on_user user
|
||||||
|
end
|
||||||
|
redirect_to return_path
|
||||||
else
|
else
|
||||||
log_on_user user
|
render text: "unable to log on user", status: 500
|
||||||
end
|
end
|
||||||
redirect_to return_path
|
rescue => e
|
||||||
else
|
details = {}
|
||||||
render text: "unable to log on user", status: 500
|
SingleSignOn::ACCESSORS.each do |a|
|
||||||
|
details[a] = sso.send(a)
|
||||||
|
end
|
||||||
|
Discourse.handle_exception(e, details)
|
||||||
|
|
||||||
|
render text: "unable to log on user contact site admin (see /logs for more info)", status: 500
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue