Class: ActionMCP::GatewayIdentifiers::WardenIdentifier
- Inherits:
-
ActionMCP::GatewayIdentifier
- Object
- ActionMCP::GatewayIdentifier
- ActionMCP::GatewayIdentifiers::WardenIdentifier
- Defined in:
- lib/action_mcp/gateway_identifiers/warden_identifier.rb
Overview
Example Gateway identifier for Warden-based authentication.
This identifier works with Warden middleware which is commonly used by Devise. Warden sets the authenticated user in request.env after successful authentication.
Instance Method Summary collapse
Methods inherited from ActionMCP::GatewayIdentifier
authenticates, identifier, #initialize
Constructor Details
This class inherits a constructor from ActionMCP::GatewayIdentifier
Instance Method Details
#resolve ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/action_mcp/gateway_identifiers/warden_identifier.rb', line 27 def resolve warden = @request.env["warden"] raise Unauthorized, "Warden not available" unless warden user = warden.user raise Unauthorized, "Not authenticated" unless user user end |