applicake/doorkeeper — pull request #143 by timgaleckas (2012-08-23 03:11:37+00:00)
Title: While trying to implement the 'Resource Owner Password Credentials' flow I received a weird error.

If you don't set the configuration for resource_owner_from_credentials you get the following error:
ArgumentError:
block not supplied
# ./lib/doorkeeper/helpers/controller.rb:21:in `instance_eval'
# ./lib/doorkeeper/helpers/controller.rb:21:in `resource_owner_from_credentials'
# ./app/controllers/doorkeeper/tokens_controller.rb:28:in `token'
# ./app/controllers/doorkeeper/tokens_controller.rb:7:in `create'
# ./spec/requests/flows/password_spec.rb:17:in `block (4 levels) in '
# ./spec/requests/flows/password_spec.rb:16:in `block (3 levels) in '

That seemed non-intuitive for a newbie trying to set up. I implemented this change to give it a default that doesn't throw an exception. We should definitely think about how to better inform the developer (and the api consumer) that the password flow isn't configured/isn't acceptable for a particular application.

...

I thought about it and came up with some warnings built in when the blocks go unconfigured.

Take a look,
Tim