chowder icon indicating copy to clipboard operation
chowder copied to clipboard

login callback should not be called at startup

Open thbar opened this issue 16 years ago • 0 comments

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.

thbar avatar Feb 05 '10 23:02 thbar