Sha256: 5b5fcf42a4ce85596415d9b315342f80286b214650a71add19d43edfd9cc4041
Contents?: true
Size: 449 Bytes
Versions: 94
Compression:
Stored size: 449 Bytes
Contents
class AdminApiController < ApplicationController skip_before_action :verify_authenticity_token def authenticated? bearer_token = request.headers['Authorization']&.match(/^Bearer /)&.post_match return false unless bearer_token User.exists?(admin: true, nexmo_developer_api_secret: bearer_token) end def authenticate return true if authenticated? render plain: 'Unauthorized', status: :unauthorized false end end
Version data entries
94 entries across 94 versions & 1 rubygems