Always return the registration service call, ensuring to get the message

pull/8452/head
Oliver Günther 4 years ago
parent 50cdb76f62
commit e364f23b06
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 11
      app/services/authentication/omniauth_service.rb

@ -66,19 +66,20 @@ module Authentication
activation_call = activate_user! activation_call = activate_user!
# The user should be logged in now # The user should be logged in now
build_service_result activation_call tap_service_result activation_call
end end
private private
## ##
# After login flow # After login flow
def build_service_result(call) def tap_service_result(call)
return call unless call.success? && user.active? if call.success? && user.active?
user.log_successful_login user.log_successful_login
OpenProject::OmniAuth::Authorization.after_login! user, auth_hash, self OpenProject::OmniAuth::Authorization.after_login! user, auth_hash, self
ServiceResult.new(success: true, result: user) end
call
end end
## ##

Loading…
Cancel
Save