mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Do not check IP on user switch in dev #2713
This commit is contained in:
parent
e3bce2325e
commit
5b01c4d39b
1 changed files with 12 additions and 10 deletions
|
@ -59,14 +59,13 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
render 'login'
|
render 'login'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# rubocop:enable Metrics/CyclomaticComplexity
|
|
||||||
# rubocop:enable Metrics/PerceivedComplexity
|
|
||||||
# rubocop:enable Metrics/MethodLength
|
# rubocop:enable Metrics/MethodLength
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
|
|
||||||
def switch_user # rubocop:disable Metrics/CyclomaticComplexity
|
def switch_user
|
||||||
@api_user = ApiUser.find(params[:id])
|
@api_user = ApiUser.find(params[:id])
|
||||||
|
|
||||||
|
unless Rails.env.development?
|
||||||
unless @api_user.registrar.registrar_ip_white?(request.ip)
|
unless @api_user.registrar.registrar_ip_white?(request.ip)
|
||||||
flash[:alert] = I18n.t(:ip_is_not_whitelisted)
|
flash[:alert] = I18n.t(:ip_is_not_whitelisted)
|
||||||
redirect_to :back and return
|
redirect_to :back and return
|
||||||
|
@ -78,11 +77,14 @@ class Registrar::SessionsController < Devise::SessionsController
|
||||||
redirect_to :back and return
|
redirect_to :back and return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
sign_in @api_user if @api_user.identity_code == current_user.identity_code
|
sign_in @api_user if @api_user.identity_code == current_user.identity_code
|
||||||
|
|
||||||
redirect_to :back
|
redirect_to :back
|
||||||
end
|
end
|
||||||
|
# rubocop:enable Metrics/CyclomaticComplexity
|
||||||
|
# rubocop:enable Metrics/PerceivedComplexity
|
||||||
|
|
||||||
def id
|
def id
|
||||||
@user = ApiUser.find_by_idc_data(request.env['SSL_CLIENT_S_DN'])
|
@user = ApiUser.find_by_idc_data(request.env['SSL_CLIENT_S_DN'])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue