diff --git a/README.md b/README.md index 0052a883..946fe425 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ So far, `everyauth` enables you to login via: kaizenpack RunKeeper Alexis Kinsella + EyeEm Nathan Kleyn Box.net @@ -2852,6 +2853,8 @@ Thanks to the following contributors for the following modules: - Evernote - [Chris Leishman](https://github.com/chrisleishman) - SoundCloud +- [Nathan Kleyn](https://github.com/nathankleyn) + - EyeEm ## MIT License Copyright (c) 2011 by Brian Noguchi diff --git a/lib/modules/eyeem.js b/lib/modules/eyeem.js new file mode 100644 index 00000000..bfba583b --- /dev/null +++ b/lib/modules/eyeem.js @@ -0,0 +1,24 @@ +var oauthModule = require('./oauth2'); + +module.exports = oauthModule.submodule('eyeem') + .oauthHost('https://www.eyeem.com') + .apiHost('https://www.eyeem.com/api/v2') + .entryPath('/auth/eyeem') + .callbackPath('/auth/eyeem/callback') + .authQueryParam('response_type', 'code') + .accessTokenPath('/api/v2/oauth/token') + .accessTokenParam('grant_type', 'authorization_code') + + .fetchOAuthUser( function (accessToken) { + var promise = this.Promise(); + + this.oauth.get(this.apiHost() + '/users/me', accessToken, function (err, data) { + var oauthUser; + + if (err) return promise.fail(err.error_message); + + oauthUser = JSON.parse(data).user; + promise.fulfill(oauthUser); + }); + return promise; + }); diff --git a/media/eyeem.ico b/media/eyeem.ico new file mode 100644 index 00000000..3437d652 Binary files /dev/null and b/media/eyeem.ico differ