From 6405bb505695a5592efe8aa8d5bde9e723fadfc0 Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Sat, 21 May 2016 22:48:00 +0800 Subject: Add support of google signin --- app.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app.js') diff --git a/app.js b/app.js index 5e75ac59..4b4e1766 100644 --- a/app.js +++ b/app.js @@ -317,6 +317,19 @@ if (config.dropbox) { res.redirect(config.serverurl); }); } +//google auth +if (config.google) { + app.get('/auth/google', + passport.authenticate('google', { scope: ['profile'] })); + //google auth callback + app.get('/auth/google/callback', + passport.authenticate('google', { + failureRedirect: config.serverurl + }), + function (req, res) { + res.redirect(config.serverurl); + }); +} //logout app.get('/logout', function (req, res) { if (config.debug && req.isAuthenticated()) -- cgit v1.2.3