mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Rename users.password
to users.plain_text_password
Otherwise it conflicts with Devise
This commit is contained in:
parent
22e70e7707
commit
32ecf36057
19 changed files with 32 additions and 24 deletions
|
@ -32,7 +32,7 @@ module Admin
|
|||
end
|
||||
|
||||
def update
|
||||
params[:api_user].delete(:password) if params[:api_user][:password].blank?
|
||||
params[:api_user].delete(:plain_text_password) if params[:api_user][:plain_text_password].blank?
|
||||
if @api_user.update(api_user_params)
|
||||
flash[:notice] = I18n.t('record_updated')
|
||||
redirect_to [:admin, @api_user]
|
||||
|
@ -59,7 +59,7 @@ module Admin
|
|||
end
|
||||
|
||||
def api_user_params
|
||||
params.require(:api_user).permit(:username, :password, :active,
|
||||
params.require(:api_user).permit(:username, :plain_text_password, :active,
|
||||
:registrar_id, :registrar_typeahead,
|
||||
:identity_code, { roles: [] })
|
||||
end
|
||||
|
|
|
@ -81,7 +81,7 @@ class Epp::SessionsController < EppController
|
|||
|
||||
if success
|
||||
if params[:parsed_frame].css('newPW').first
|
||||
unless @api_user.update(password: params[:parsed_frame].css('newPW').first.text)
|
||||
unless @api_user.update(plain_text_password: params[:parsed_frame].css('newPW').first.text)
|
||||
response.headers['X-EPP-Returncode'] = '2500'
|
||||
handle_errors(@api_user) and return
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ class Epp::SessionsController < EppController
|
|||
def login_params
|
||||
user = params[:parsed_frame].css('clID').first.text
|
||||
pw = params[:parsed_frame].css('pw').first.text
|
||||
{ username: user, password: pw }
|
||||
{ username: user, plain_text_password: pw }
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -22,7 +22,7 @@ class Registrar
|
|||
return nil unless current_registrar_user
|
||||
@depp_current_user ||= Depp::User.new(
|
||||
tag: current_registrar_user.username,
|
||||
password: current_registrar_user.password
|
||||
password: current_registrar_user.plain_text_password
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class Registrar
|
|||
uri = URI.parse("#{ENV['repp_url']}domain_transfers")
|
||||
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
||||
request.body = { data: { domainTransfers: domain_transfers } }.to_json
|
||||
request.basic_auth(current_registrar_user.username, current_registrar_user.password)
|
||||
request.basic_auth(current_registrar_user.username, current_registrar_user.plain_text_password)
|
||||
|
||||
|
||||
if Rails.env.test?
|
||||
|
|
|
@ -12,7 +12,7 @@ class Registrar
|
|||
attributes: { hostname: params[:new_hostname],
|
||||
ipv4: ipv4,
|
||||
ipv6: ipv6 } } }.to_json
|
||||
request.basic_auth(current_registrar_user.username, current_registrar_user.password)
|
||||
request.basic_auth(current_registrar_user.username, current_registrar_user.plain_text_password)
|
||||
|
||||
if Rails.env.test?
|
||||
response = Net::HTTP.start(uri.hostname, uri.port,
|
||||
|
|
|
@ -26,7 +26,8 @@ class Registrar
|
|||
@depp_user.errors.add(:base, :webserver_client_cert_directive_should_be_required)
|
||||
end
|
||||
|
||||
@api_user = ApiUser.find_by(username: params[:depp_user][:tag], password: params[:depp_user][:password])
|
||||
@api_user = ApiUser.find_by(username: params[:depp_user][:tag],
|
||||
plain_text_password: params[:depp_user][:password])
|
||||
|
||||
unless @api_user
|
||||
@depp_user.errors.add(:base, t(:no_such_user))
|
||||
|
|
|
@ -8,7 +8,7 @@ class Registrar
|
|||
request = Net::HTTP::Patch.new(uri)
|
||||
request.set_form_data(current_contact_id: params[:current_contact_id],
|
||||
new_contact_id: params[:new_contact_id])
|
||||
request.basic_auth(current_registrar_user.username, current_registrar_user.password)
|
||||
request.basic_auth(current_registrar_user.username, current_registrar_user.plain_text_password)
|
||||
|
||||
if Rails.env.test?
|
||||
response = Net::HTTP.start(uri.hostname, uri.port,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue