borismus/oauth2-extensions — pull request #4 by neocotic (2012-03-02 12:37:22+00:00)
Title: Improved API and bitly adapter

I've improved the error handling so that the callback method is called even if the user denies access. Now the call back should only be missed if the user closes the OAuth flow tab. A new `hasAccessToken` method has been added to the API to allow simple existence checking. This is useful to the implementing code when authorizing and/or using alternative approaches for unauthenticated users.

Created a new [bit.ly](http://bit.ly) adapter has been added and is only missing error handling as this is not mentioned in [their API documentation](http://code.google.com/p/bitly-api/wiki/ApiDocumentation) (along with a lot of information developers would consider useful). That said; the adapter works perfectly fine and I'm using this in the next release of my extension, [Template](https://github.com/neocotic/template).

Added missing `access_type=offline` parameter to the authorization code URL returned by the Google adapter adapter. This is the only way in which refresh tokens can be returned according to [their new OAuth 2.0 documentation](https://developers.google.com/accounts/docs/OAuth2WebServer#offline).

Finally, I went through all of the code and inline documentation, making it more consistent and clean.

**P.S.** Great library! A massive improvement on the one mentioned in the tutorial and the web flow approach is a genius usage of the Chrome API. I'd prefer to see this library in the official documentation.