|
|
@ -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 |
|
|
|
|
|
|
|
|
|
|
|
## |
|
|
|
## |
|
|
|