Merge branch 'registry-918' into registry-922

This commit is contained in:
Maciej Szlosarczyk 2018-08-07 14:54:16 +03:00
commit e3807f694d
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
4 changed files with 5 additions and 5 deletions

View file

@ -21,7 +21,7 @@ module Api
if token
render json: token
else
render json: { error: 'Cannot create generate session token' }
render json: { errors: [{ base: ['Cannot create generate session token'] }] }
end
end
@ -46,7 +46,7 @@ module Api
allowed_ips = ENV['registrant_api_auth_allowed_ips'].to_s.split(',').map(&:strip)
return if allowed_ips.include?(request.ip) || Rails.env.development?
render json: { errors: ['Not authorized'] }, status: :unauthorized
render json: { errors: [{ base: ['Not authorized'] }] }, status: :unauthorized
end
end
end

View file

@ -29,7 +29,7 @@ module Api
if decryptor.valid?
sign_in decryptor.user
else
render json: { errors: ['Not authorized'] }, status: :unauthorized
render json: { errors: [{base: ['Not authorized']}] }, status: :unauthorized
end
end
end