do not authenticate archived users

This commit is contained in:
Pete Matsyburka
2024-01-16 00:12:55 +02:00
parent ce1323e849
commit 49cea59b94
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ module Api
if request.headers['X-Auth-Token'].present?
sha256 = Digest::SHA256.hexdigest(request.headers['X-Auth-Token'])
User.joins(:access_token).find_by(access_token: { sha256: })
User.joins(:access_token).active.find_by(access_token: { sha256: })
end
render json: { error: 'Not authenticated' }, status: :unauthorized unless current_user