Skip to content

Instantly share code, notes, and snippets.

@stenehall
Created August 29, 2013 19:58
Show Gist options
  • Save stenehall/6382710 to your computer and use it in GitHub Desktop.
Save stenehall/6382710 to your computer and use it in GitHub Desktop.
var passport = require('passport');
var util = require('util');
var GitHubStrategy = require('passport-github').Strategy;
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(obj, done) {
done(null, obj);
});
passport.use(new GitHubStrategy({
clientID: '...',
clientSecret: '...',
callbackURL: "http://.../auth/github/callback"
},
function(accessToken, refreshToken, profile, done) {
process.nextTick(function () {
return done(null, profile);
});
}
));
app.use(express.session({ secret: '...' }));
app.use(passport.initialize());
app.use(passport.session());
app.get('/auth/github',
passport.authenticate('github'),
function(req, res){
// The request will be redirected to GitHub for authentication, so this
// function will not be called.
});
{ [error: invalid input syntax for integer: "auth"]
name: 'error',
length: 86,
severity: 'ERROR',
code: '22P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
file: 'numutils.c',
line: '62',
routine: 'pg_atoi' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment