diff --git a/README.md b/README.md
index 733d3f51..4139f8ed 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,7 @@ So far, `everyauth` enables you to login via:
OpenId | RocketLabs Development, Andrew Mee, Brian Noguchi
|
LDAP (experimental; not production-tested) |
|
Windows Azure Access Control Service (ACS) | Dario Renzulli, Juan Pablo Garcia, Matias Woloski from Southworks
+ |
Dailycred | Hank Stoever at Dailycred.com
@@ -2377,6 +2378,18 @@ object whose parameter name keys map to description values:
everyauth.box.configurable();
```
+### Dailycred OAuth
+
+```javascript
+everyauth.dailycred
+ .appId(conf.dc.appId)
+ .findOrCreateUser( function (session, accessToken, accessTokenExtra, dcUserMetadata) {
+ return usersByDcId[dcUserMetadata.id] ||
+ (usersByDcId[dcUserMetadata.id] = addUser('dailycred', dcUserMetadata));
+ })
+ .redirectPath('/');
+```
+
## Configuring a Module
everyauth was built with powerful configuration needs in mind.
diff --git a/lib/modules/dailycred.js b/lib/modules/dailycred.js
index 74253286..10ef5292 100644
--- a/lib/modules/dailycred.js
+++ b/lib/modules/dailycred.js
@@ -4,11 +4,11 @@ var oauthModule = require('./oauth2')
var dc = module.exports =
oauthModule.submodule('dailycred')
- .apiHost('https://auth.dailycred.com')
- .oauthHost('https://auth.dailycred.com')
+ .apiHost('https://www.dailycred.com')
+ .oauthHost('https://www.dailycred.com')
- .authPath('https://auth.dailycred.com/oauth/authorize')
- .accessTokenPath('/oauth/tokeninfo')
+ .authPath('https://www.dailycred.com/oauth/authorize')
+ .accessTokenPath('/oauth/api/token.json')
.entryPath('/auth/dailycred')
.callbackPath('/auth/dailycred/callback')
@@ -31,7 +31,7 @@ oauthModule.submodule('dailycred')
.fetchOAuthUser( function (accessToken) {
var p = this.Promise();
- this.oauth.get(this.apiHost() + '/oauth/me', accessToken, function (err, data) {
+ this.oauth.get(this.apiHost() + '/oauth/api/me.json', accessToken, function (err, data) {
if (err) return p.fail(err);
var oauthUser = JSON.parse(data);
p.fulfill(oauthUser);
|