FIX: add increased logging around when users are logged out
https://github.com/mozilla/discourse/issues/188
This commit is contained in:
Родитель
7b36d1ff86
Коммит
652d284ad0
|
@ -27,19 +27,24 @@ module MozillaIAM
|
|||
end
|
||||
|
||||
if last_refresh + logout_delay < Time.now
|
||||
reset_session
|
||||
log_off_user
|
||||
raise <<~EOF
|
||||
Mozilla IAM: User session expired
|
||||
user_id: #{current_user.id}, last_refresh: #{last_refresh}, logout_delay: #{logout_delay}
|
||||
EOF
|
||||
else
|
||||
refresh_iam_session
|
||||
unless Profile.for(current_user).is_aal_enough?(session[:mozilla_iam].try(:[], :aal))
|
||||
reset_session
|
||||
log_off_user
|
||||
aal = session[:mozilla_iam].try(:[], :aal)
|
||||
unless Profile.for(current_user).is_aal_enough?(aal)
|
||||
raise <<~EOF
|
||||
Mozilla IAM: AAL not enough, user logged out
|
||||
user_id: #{current_user.id}, aal: #{aal}
|
||||
EOF
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
Rails.logger.warn("Killed session for user #{current_user.id}: #{e.class} (#{e.message})\n#{e.backtrace.join("\n")}")
|
||||
reset_session
|
||||
log_off_user
|
||||
raise e
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# name: mozilla-iam
|
||||
# about: A plugin to integrate Discourse with Mozilla's Identity and Access Management (IAM) system
|
||||
# version: 1.1.2
|
||||
# version: 1.1.3
|
||||
# authors: Leo McArdle
|
||||
# url: https://github.com/mozilla/discourse-mozilla-iam
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче