chowder
chowder copied to clipboard
login callback should not be called at startup
Not a big deal but it took me a bit of time to understand what was happening, so I'll document it here. Maybe there's a clever workaround to imagine; my current work-around is just to always use the ":login =>" form instead of the do xxx form.
When defining the login callback like this:
use Chowder::OpenID do |url| user = User.first(:openid => url) and user.id end
Sinatra 0.9.4 base.rb (line 359) does:
yield self if block_given?
So the login callback is called mistakingly, with Chowder::OpenId as a param.