Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ function Strategy(options, verify) {
options = options || {};
options.authorizationURL = options.authorizationURL || 'https://www.dwolla.com/oauth/v2/authenticate';
options.tokenURL = options.tokenURL || 'https://www.dwolla.com/oauth/v2/token';

OAuth2Strategy.call(this, options, verify);
this.name = 'dwolla';

this._oauth2.setAccessTokenName("oauth_token");
}

Expand All @@ -72,19 +72,19 @@ util.inherits(Strategy, OAuth2Strategy);
* @api protected
*/
Strategy.prototype.userProfile = function(accessToken, done) {
this._oauth2.get('https://www.dwolla.com/oauth/rest/accountapi/accountinformation', accessToken, function (err, body, res) {
this._oauth2.get('https://www.dwolla.com/oauth/rest/users/', accessToken, function (err, body, res) {
if (err) { return done(new InternalOAuthError('failed to fetch user profile', err)); }

try {
var json = JSON.parse(body);

var profile = { provider: 'dwolla' };
profile.id = json['Id'];
profile.displayName = json['Name'];

profile._raw = body;
profile._json = json;

done(null, profile);
} catch(e) {
done(e);
Expand Down