fix style, add product links

This commit is contained in:
Alex Turchyn
2023-07-04 23:05:22 +03:00
parent 70211b24c5
commit 95f7fff53d
11 changed files with 65 additions and 15 deletions
+9 -1
View File
@@ -16,7 +16,15 @@ class AccountsController < ApplicationController
@encrypted_config = EncryptedConfig.find_or_initialize_by(account: current_account,
key: EncryptedConfig::APP_URL_KEY)
@encrypted_config.update!(app_url_params)
@encrypted_config.assign_attributes(app_url_params)
unless URI.parse(@encrypted_config.value.to_s).class.in?([URI::HTTP, URI::HTTPS])
@encrypted_config.errors.add(:value, 'should be a valid URL')
return render :show, status: :unprocessable_entity
end
@encrypted_config.save!
Docuseal.refresh_default_url_options!
+7
View File
@@ -19,6 +19,13 @@ class SetupController < ApplicationController
@user = @account.users.new(user_params)
unless URI.parse(encrypted_config_params[:value].to_s).class.in?([URI::HTTP, URI::HTTPS])
@encrypted_config = EncryptedConfig.new(encrypted_config_params)
@encrypted_config.errors.add(:value, 'should be a valid URL')
return render :index, status: :unprocessable_entity
end
if @user.save
encrypted_configs = [
{ key: EncryptedConfig::APP_URL_KEY, value: encrypted_config_params[:value] },