mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Return error when API user not found in REPP #2774
This commit is contained in:
parent
1b9bc92660
commit
f2992b7f45
3 changed files with 15 additions and 0 deletions
|
@ -5,6 +5,11 @@ module Repp
|
|||
|
||||
http_basic do |username, password|
|
||||
@current_user ||= ApiUser.find_by(username: username, password: password)
|
||||
if @current_user
|
||||
true
|
||||
else
|
||||
error! I18n.t('api_user_not_found'), 401
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue