refactor
This commit is contained in:
@@ -14,7 +14,8 @@ class SessionsController < ApplicationController
|
||||
else
|
||||
signup = Signup.new(email_address: email_address)
|
||||
if signup.valid?(:identity_creation)
|
||||
redirect_to_session_magic_link signup.create_identity
|
||||
identity = signup.create_identity unless single_tenant?
|
||||
redirect_to_session_magic_link identity
|
||||
else
|
||||
head :unprocessable_entity
|
||||
end
|
||||
|
||||
@@ -16,7 +16,6 @@ class Signup
|
||||
end
|
||||
|
||||
def create_identity
|
||||
return if single_tenant?
|
||||
@identity = Identity.find_or_create_by!(email_address: email_address)
|
||||
@identity.send_magic_link for: :sign_up
|
||||
end
|
||||
@@ -97,8 +96,4 @@ class Signup
|
||||
attributes[:referrer] = Current.referrer
|
||||
end
|
||||
end
|
||||
|
||||
def single_tenant?
|
||||
ENV.fetch("SINGLE_TENANT", "false") == "true"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user