mirror of
https://github.com/internetee/registry.git
synced 2025-08-02 16:02:03 +02:00
Check IP in registrar
This commit is contained in:
parent
19e133ec6a
commit
940355a417
4 changed files with 33 additions and 2 deletions
|
@ -5,6 +5,8 @@ class Registrar::SessionsController < ::SessionsController
|
|||
false
|
||||
end
|
||||
|
||||
before_action :check_ip
|
||||
|
||||
def login
|
||||
@depp_user = Depp::User.new
|
||||
end
|
||||
|
@ -139,4 +141,11 @@ class Registrar::SessionsController < ::SessionsController
|
|||
return User.new unless idc
|
||||
ApiUser.find_by(identity_code: idc) || User.new
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def check_ip
|
||||
return if WhiteIp.registrar_ip_white?(request.ip)
|
||||
render text: t('ip_is_not_whitelisted') and return
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue