mirror of
https://github.com/czhu12/canine.git
synced 2026-02-15 00:19:12 -06:00
stop using example.com in letsencrypt email
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class Local::CreateDefaultUser
|
||||
BASE_DOMAIN = "oncanine.run"
|
||||
extend LightService::Action
|
||||
|
||||
promises :user, :account
|
||||
@@ -6,7 +7,7 @@ class Local::CreateDefaultUser
|
||||
executed do |context|
|
||||
ActiveRecord::Base.transaction do
|
||||
context.user = User.first || User.new
|
||||
context.user.email = "#{ENV["CANINE_USERNAME"].presence || SecureRandom.uuid}@example.com"
|
||||
context.user.email = "#{ENV["CANINE_USERNAME"].presence || SecureRandom.uuid}@#{BASE_DOMAIN}"
|
||||
context.user.password = ENV["CANINE_PASSWORD"].presence || "password"
|
||||
context.user.password_confirmation = ENV["CANINE_PASSWORD"].presence || "password"
|
||||
context.user.save!
|
||||
|
||||
@@ -27,7 +27,7 @@ module Local::Authentication
|
||||
end
|
||||
if ENV["CANINE_USERNAME"].presence && ENV["CANINE_PASSWORD"].presence
|
||||
authenticate_or_request_with_http_basic do |username, password|
|
||||
@current_user = User.find_by!(email: "#{username}@example.com")
|
||||
@current_user = User.find_by!(email: "#{username}@#{Local::CreateDefaultUser::BASE_DOMAIN}")
|
||||
@current_account = @current_user.accounts.first
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user