Skip to content

Commit

Permalink
Email variable was not populated before checking RESTRICTED_DOMAIN (#152
Browse files Browse the repository at this point in the history
)

Moved the variables up above that code block. It solves the error
when a restricted domain is used.
  • Loading branch information
joelklabo authored and KrauseFx committed May 11, 2017
1 parent 6bd8d28 commit b99ca12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/invite_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def submit
render :index
return
end

email = params[:email]
first_name = params[:first_name]
last_name = params[:last_name]

if ENV["RESTRICTED_DOMAIN"]
domains = ENV["RESTRICTED_DOMAIN"].split(",")
Expand All @@ -52,10 +56,6 @@ def submit
end
end

email = params[:email]
first_name = params[:first_name]
last_name = params[:last_name]

if email.length == 0
render :index
return
Expand Down

0 comments on commit b99ca12

Please sign in to comment.