-
Notifications
You must be signed in to change notification settings - Fork 2
/
passport.js
34 lines (29 loc) · 964 Bytes
/
passport.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var passport = require("passport"),
config = require("./app.js"),
api_key = config.web_settings.apikey,
SteamStrategy = require("passport-steam").Strategy,
host = config.web_settings.baseurl + ":" + config.web_settings.port;
//passport.serializeUser(function(user, done) {
// //console.log("TEST user: " + JSON.stringify(user));
// done(null, user.account_id);
//});
//
//passport.deserializeUser(function(obj, done) {
// //console.log("TEST obj: " + JSON.stringify(obj));
// done(null, obj);
//});
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(user, done) {
done(null, user);
});
passport.use(new SteamStrategy({
returnURL: host + "/return",
realm: host,
apiKey: api_key
}, function initializeUser(identifier, profile, done) {
//console.log("TEST profile: " + JSON.stringify(profile));
return done(null, profile);
}));
module.exports = passport;