mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Do not overwrite auth info on domain create #2833
This commit is contained in:
parent
a447c8653c
commit
eff8dd5d7a
3 changed files with 8 additions and 5 deletions
|
@ -528,8 +528,13 @@ class Domain < ActiveRecord::Base
|
||||||
Registrant.find_by(id: pending_json['domain']['registrant_id'].last)
|
Registrant.find_by(id: pending_json['domain']['registrant_id'].last)
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:disable Lint/Loop
|
|
||||||
def generate_auth_info
|
def generate_auth_info
|
||||||
|
return if auth_info.present?
|
||||||
|
generate_auth_info!
|
||||||
|
end
|
||||||
|
|
||||||
|
# rubocop:disable Lint/Loop
|
||||||
|
def generate_auth_info!
|
||||||
begin
|
begin
|
||||||
self.auth_info = SecureRandom.hex
|
self.auth_info = SecureRandom.hex
|
||||||
end while self.class.exists?(auth_info: auth_info)
|
end while self.class.exists?(auth_info: auth_info)
|
||||||
|
|
|
@ -616,7 +616,7 @@ class Epp::Domain < Domain
|
||||||
if dt.approved?
|
if dt.approved?
|
||||||
transfer_contacts(current_user.registrar_id)
|
transfer_contacts(current_user.registrar_id)
|
||||||
dt.notify_losing_registrar(old_contact_codes, old_registrant_code)
|
dt.notify_losing_registrar(old_contact_codes, old_registrant_code)
|
||||||
generate_auth_info
|
generate_auth_info!
|
||||||
self.registrar = current_user.registrar
|
self.registrar = current_user.registrar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -353,9 +353,7 @@ module Epp
|
||||||
defaults = {
|
defaults = {
|
||||||
name: { value: next_domain_name },
|
name: { value: next_domain_name },
|
||||||
period: nil,
|
period: nil,
|
||||||
authInfo: {
|
authInfo: nil
|
||||||
pw: { value: '98oiewslkfkd', attrs: { roid: 'citizen_1234-REP' } }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xml_params = defaults.deep_merge(xml_params)
|
xml_params = defaults.deep_merge(xml_params)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue