This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github signin/signup to the list of signups/signi's
- Loading branch information
Showing
8 changed files
with
142 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
var passport = require('passport'), | ||
url = require('url'), | ||
GithubStrategy = require('passport-github').Strategy, | ||
config = require('../config'), | ||
users = require('../../app/controllers/users'); | ||
|
||
module.exports = function() { | ||
// Use github strategy | ||
passport.use(new GithubStrategy({ | ||
clientID: config.github.clientID, | ||
clientSecret: config.github.clientSecret, | ||
callbackURL: config.github.callbackURL, | ||
passReqToCallback: true | ||
}, | ||
function(req, accessToken, refreshToken, profile, done) { | ||
// Set the provider data and include tokens | ||
var providerData = profile._json; | ||
providerData.accessToken = accessToken; | ||
providerData.refreshToken = refreshToken; | ||
|
||
// Create the user OAuth profile | ||
var providerUserProfile = { | ||
firstName: profile.name.givenName, | ||
lastName: profile.name.familyName, | ||
displayName: profile.displayName, | ||
email: profile.emails[0].value, | ||
username: profile.username, | ||
provider: 'github', | ||
providerIdentifierField: 'id', | ||
providerData: providerData | ||
}; | ||
|
||
// Save the user OAuth profile | ||
users.saveOAuthUserProfile(req, providerUserProfile, done); | ||
} | ||
)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,70 @@ | ||
{ | ||
"name": "meanjs", | ||
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.", | ||
"version": "0.3.1", | ||
"private": false, | ||
"author": "https://github.com/meanjs/mean/graphs/contributors", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/meanjs/mean.git" | ||
}, | ||
"engines": { | ||
"node": "0.10.x", | ||
"npm": "1.4.x" | ||
}, | ||
"scripts": { | ||
"start": "grunt", | ||
"test": "grunt test", | ||
"postinstall": "bower install --config.interactive=false" | ||
}, | ||
"dependencies": { | ||
"express": "~4.2.0", | ||
"express-session": "~1.1.0", | ||
"body-parser": "~1.2.0", | ||
"cookie-parser": "~1.1.0", | ||
"compression": "~1.0.1", | ||
"method-override": "~1.0.0", | ||
"morgan": "~1.1.0", | ||
"connect-mongo": "~0.4.0", | ||
"connect-flash": "~0.1.1", | ||
"helmet": "~0.2.1", | ||
"consolidate": "~0.10.0", | ||
"swig": "~1.3.2", | ||
"mongoose": "~3.8.8", | ||
"passport": "~0.2.0", | ||
"passport-local": "~1.0.0", | ||
"passport-facebook": "~1.0.2", | ||
"passport-twitter": "~1.0.2", | ||
"passport-linkedin": "~0.1.3", | ||
"passport-google-oauth": "~0.1.5", | ||
"lodash": "~2.4.1", | ||
"forever": "~0.11.0", | ||
"bower": "~1.3.1", | ||
"grunt-cli": "~0.1.13", | ||
"glob": "~3.2.9" | ||
}, | ||
"devDependencies": { | ||
"supertest": "~0.12.1", | ||
"should": "~3.3.1", | ||
"grunt-env": "~0.4.1", | ||
"grunt-node-inspector": "~0.1.3", | ||
"grunt-contrib-watch": "~0.6.1", | ||
"grunt-contrib-jshint": "~0.10.0", | ||
"grunt-contrib-csslint": "^0.2.0", | ||
"grunt-ngmin": "0.0.3", | ||
"grunt-contrib-uglify": "~0.4.0", | ||
"grunt-contrib-cssmin": "~0.9.0", | ||
"grunt-nodemon": "~0.2.1", | ||
"grunt-concurrent": "~0.5.0", | ||
"grunt-mocha-test": "~0.10.0", | ||
"grunt-karma": "~0.8.2", | ||
"load-grunt-tasks": "~0.4.0", | ||
"karma": "~0.12.0", | ||
"karma-jasmine": "~0.2.1", | ||
"karma-coverage": "~0.2.0", | ||
"karma-chrome-launcher": "~0.1.2", | ||
"karma-firefox-launcher": "~0.1.3", | ||
"karma-phantomjs-launcher": "~0.1.2" | ||
} | ||
} | ||
"name": "meanjs", | ||
"description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.", | ||
"version": "0.3.1", | ||
"private": false, | ||
"author": "https://github.com/meanjs/mean/graphs/contributors", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/meanjs/mean.git" | ||
}, | ||
"engines": { | ||
"node": "0.10.x", | ||
"npm": "1.4.x" | ||
}, | ||
"scripts": { | ||
"start": "grunt", | ||
"test": "grunt test", | ||
"postinstall": "bower install --config.interactive=false" | ||
}, | ||
"dependencies": { | ||
"body-parser": "~1.2.0", | ||
"bower": "~1.3.1", | ||
"compression": "~1.0.1", | ||
"connect-flash": "~0.1.1", | ||
"connect-mongo": "~0.4.0", | ||
"consolidate": "~0.10.0", | ||
"cookie-parser": "~1.1.0", | ||
"express": "~4.2.0", | ||
"express-session": "~1.1.0", | ||
"forever": "~0.11.0", | ||
"glob": "~3.2.9", | ||
"grunt-cli": "~0.1.13", | ||
"helmet": "~0.2.1", | ||
"lodash": "~2.4.1", | ||
"method-override": "~1.0.0", | ||
"mongoose": "~3.8.8", | ||
"morgan": "~1.1.0", | ||
"passport": "~0.2.0", | ||
"passport-facebook": "~1.0.2", | ||
"passport-github": "^0.1.5", | ||
"passport-google-oauth": "~0.1.5", | ||
"passport-linkedin": "~0.1.3", | ||
"passport-local": "~1.0.0", | ||
"passport-twitter": "~1.0.2", | ||
"swig": "~1.3.2" | ||
}, | ||
"devDependencies": { | ||
"supertest": "~0.12.1", | ||
"should": "~3.3.1", | ||
"grunt-env": "~0.4.1", | ||
"grunt-node-inspector": "~0.1.3", | ||
"grunt-contrib-watch": "~0.6.1", | ||
"grunt-contrib-jshint": "~0.10.0", | ||
"grunt-contrib-csslint": "^0.2.0", | ||
"grunt-ngmin": "0.0.3", | ||
"grunt-contrib-uglify": "~0.4.0", | ||
"grunt-contrib-cssmin": "~0.9.0", | ||
"grunt-nodemon": "~0.2.1", | ||
"grunt-concurrent": "~0.5.0", | ||
"grunt-mocha-test": "~0.10.0", | ||
"grunt-karma": "~0.8.2", | ||
"load-grunt-tasks": "~0.4.0", | ||
"karma": "~0.12.0", | ||
"karma-jasmine": "~0.2.1", | ||
"karma-coverage": "~0.2.0", | ||
"karma-chrome-launcher": "~0.1.2", | ||
"karma-firefox-launcher": "~0.1.3", | ||
"karma-phantomjs-launcher": "~0.1.2" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters