Return error when API user not found in REPP #2774

This commit is contained in:
Martin Lensment 2015-07-20 18:19:02 +03:00
parent 1b9bc92660
commit f2992b7f45
3 changed files with 15 additions and 0 deletions

View file

@ -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