Permalink
Browse files

set the unauthenticated POST route to /session/unauthenticated

  • Loading branch information...
dodeja committed Jan 27, 2012
1 parent 5924b6c commit 3c505d23218e93e42583c8299f1954cbcb67a208
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/padrino/warden.rb
View
@@ -82,12 +82,14 @@ def self.registered(app)
app.set :auth_use_oauth, false
app.use ::Warden::Manager do |manager|
- manager.default_strategies :password
+ manager.scope_defaults :default,
+ strategies: [:password],
+ action: 'session/unauthenticated'
manager.failure_app = app
end
app.controller :sessions do
- post :unauthenticated, :map => '/unauthenticated' do
+ post :unauthenticated do
status 401
warden.custom_failure! if warden.config.failure_app == self.class
flash.now[:error] = settings.auth_error_message if flash

0 comments on commit 3c505d2

Please sign in to comment.