Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ server.get('/api/OAuthCallback/',

bot.receive(continueMsg.toMessage());
res.send('Welcome ' + req.user.displayName + '! Please copy this number and paste it back to your chat so your authentication can complete: ' + magicCode);

/* //For users who are deploying the bot on a website, if they want the user to receive the authentication code in html format (since some browsers don't support JSON..like IE) to improve user experience, Please replace line num 91 (res.send...) with the code below (or uncomment this code snippet):

var body = '<html><body>Welcome ' + req.user.displayName + '! Please copy this number and paste it back to your chat so your authentication can complete: ' + magicCode'</body></html>';
res.writeHead(200, {
'Content-Length': Buffer.byteLength(body),
'Content-Type': 'text/html'
});
res.write(body);
res.end();

*/
});

passport.serializeUser(function(user, done) {
Expand Down Expand Up @@ -392,4 +404,4 @@ function getUserLatestEmail(accessToken, callback) {
}).on('error', function (e) {
callback(e, null);
});
}
}