Skip to content

Commit 1443393

Browse files
Daniel Nelsonsteveklabnik
authored andcommitted
added warden authentication example to resque-web rails 3 instructions (slightly modified version of https://gist.github.com/1575082, by https://github.com/cwise)
1 parent decd363 commit 1443393

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.markdown

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,18 @@ You can also mount Resque on a subpath in your existing Rails 3 app by adding `r
501501
mount Resque::Server.new, :at => "/resque"
502502
```
503503

504+
If you use Devise, the following will integrate with your existing admin authentication (assuming you have an Admin Devise scope):
505+
506+
``` ruby
507+
resque_constraint = lambda do |request|
508+
request.env['warden'].authenticate!({ :scope => :admin })
509+
end
510+
constraints resque_constraint do
511+
mount Resque::Server.new, :at => "/resque"
512+
end
513+
```
514+
515+
504516

505517
Resque vs DelayedJob
506518
--------------------

0 commit comments

Comments
 (0)