Enable letsencrypt updates for domain changes

This commit is contained in:
Kyle Drake 2016-07-03 02:10:49 +00:00
parent 69996cb5e8
commit 9c17b9cddb

View file

@ -225,6 +225,7 @@ post '/settings/:username/custom_domain' do
require_login
require_ownership_for_settings
original_domain = @site.domain
@site.domain = params[:domain]
begin
@ -243,7 +244,11 @@ post '/settings/:username/custom_domain' do
if @site.valid?
@site.save_changes
LetsEncryptWorker.perform_async @site.id
if @site.domain != original_domain
LetsEncryptWorker.perform_async @site.id
end
flash[:success] = 'The domain has been successfully updated.'
redirect "/settings/#{@site.username}#custom_domain"
else