mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Add support of google signin
This commit is contained in:
parent
900141daff
commit
6405bb5056
10 changed files with 47 additions and 8 deletions
13
app.js
13
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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue