Skip to content

Commit

Permalink
Refactor for better understandability
Browse files Browse the repository at this point in the history
  • Loading branch information
tramuntanal committed Jan 29, 2021
1 parent 170e632 commit 184c7f1
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def call
# we can not reuse existing authorization because it will raise "A participant is already authorized with the same data." on @form.valid?
# as it is an impersonated user, we can safely destroy it and perform the verification process again
transaction do
@user = @authorization.user
user.skip_confirmation!
destroy_authorization
if @form.valid?
authorize_user
Expand Down Expand Up @@ -60,13 +62,8 @@ def existing_registered_user?
@user = @authorization.user unless @authorization.user.managed?
end

# Searches for an authentication user associated to the given form authorizations
# The user should BE managed.
def existing_impersonated_user?
if @authorization.user.managed?
@user = @authorization.user
user.skip_confirmation!
end
@authorization.user.managed?
end

# Some authentication already exists?
Expand Down

0 comments on commit 184c7f1

Please sign in to comment.