Path: | lib/merb-auth-core/router_helper.rb |
Last Update: | Mon Mar 15 14:03:45 -0600 2010 |
Use this method in your router to ensure that the user is authenticated
This will run through any strategies that you have setup, or that you declare as an argument to the authenticate method.
authenticate(OpenID) do resource :posts authenticate do match("/").to(:controller => "home") end end
This is a simple example that shows protecting the entire set of routes for the posts resource with the OpenID strategy.
The match on "/" is protected, first by the OpenID strategy, then by the dfeeault set of stratgies. Strategies are applied from the outer block first, working to the inner blocks.