mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Add more SSO logging for failure conditions
This commit is contained in:
parent
953ac7de8f
commit
d3b24b625b
1 changed files with 17 additions and 7 deletions
|
@ -43,15 +43,25 @@ class SessionController < ApplicationController
|
|||
return_path = sso.return_path
|
||||
sso.expire_nonce!
|
||||
|
||||
if user = sso.lookup_or_create_user
|
||||
if SiteSetting.must_approve_users? && !user.approved?
|
||||
# TODO: need an awaiting approval message here
|
||||
begin
|
||||
if user = sso.lookup_or_create_user
|
||||
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
|
||||
log_on_user user
|
||||
render text: "unable to log on user", status: 500
|
||||
end
|
||||
redirect_to return_path
|
||||
else
|
||||
render text: "unable to log on user", status: 500
|
||||
rescue => e
|
||||
details = {}
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue