mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Enable letsencrypt updates for domain changes
This commit is contained in:
parent
69996cb5e8
commit
9c17b9cddb
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue