Open
Description
Would it be possible to perform authentication on CypressOnRails Commands?
There is a workaround: by injecting another middleware before cypress_on_rails
, checking for the /__e2e__/command
route and performing authentication.
But it would be great if we could configure it directly in Cypress On Rails 🙏 . One idea would be to accept a before_request
block:
CypressOnRails.configure do |c|
# ...
c.before_request = lambda { |request|
if !request.env['warden'].authenticate(:secret_key)
[403, {}, ["forbidden"]]
end
return request.env
}
end
This block would be executed as part of the CypressOnRails middleware.
If you like the idea, I'm happy to open a PR 🙂
Metadata
Metadata
Assignees
Labels
No labels