You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 22, 2021. It is now read-only.
I'm looking at authenticating Shrine presigned routes through constraints and if the Knock::Authenticatable could be leveraged in a route constraint.
Something like:
lib/constraints/authenticated_request.rb
module Constraints
class AuthenticatedRequest
include Knock::Authenticable
def matches?(request)
auth_header = request.headers.fetch('Authorization')
return false unless auth_header
authenticate_user
end
end
end
and in routes:
mount ImageUploader.presign_endpoint(:cache) => '/images/presign', constraints: Constraints::AuthenticatedRequest.new
I'm looking at authenticating Shrine presigned routes through constraints and if the Knock::Authenticatable could be leveraged in a route constraint.
Something like:
lib/constraints/authenticated_request.rb
and in routes: