mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Fix codeclimate issues
This commit is contained in:
parent
06f5eb10d4
commit
90b2455032
5 changed files with 13 additions and 14 deletions
|
@ -19,7 +19,7 @@ module API
|
|||
def bearer_token
|
||||
pattern = /^Bearer /
|
||||
header = request.headers['Authorization']
|
||||
header.gsub(pattern, '') if header && header.match(pattern)
|
||||
header.gsub(pattern, '') if header&.match(pattern)
|
||||
end
|
||||
|
||||
def authenticate
|
||||
|
@ -29,7 +29,7 @@ module API
|
|||
if decryptor.valid?
|
||||
sign_in decryptor.user
|
||||
else
|
||||
render json: { error: 'Not authorized' }, status: 401
|
||||
render json: { error: 'Not authorized' }, status: :unauthorized
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue