mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Allow updating password via EPP
This commit is contained in:
parent
a42136268f
commit
a79ef51ed9
4 changed files with 53 additions and 0 deletions
|
@ -19,6 +19,12 @@ class Epp::SessionsController < EppController
|
|||
end
|
||||
|
||||
if @api_user.try(:active) && cert_valid
|
||||
if parsed_frame.css('newPW').first
|
||||
unless @api_user.update(password: parsed_frame.css('newPW').first.text)
|
||||
handle_errors(@api_user) and return
|
||||
end
|
||||
end
|
||||
|
||||
epp_session[:api_user_id] = @api_user.id
|
||||
render_epp_response('login_success')
|
||||
else
|
||||
|
@ -42,4 +48,8 @@ class Epp::SessionsController < EppController
|
|||
ph = params_hash['epp']['command']['login']
|
||||
{ username: ph[:clID], password: ph[:pw] }
|
||||
end
|
||||
|
||||
def parsed_frame
|
||||
@parsed_frame ||= Nokogiri::XML(request.params[:raw_frame]).remove_namespaces!
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue