add github auth
parent
f6564884a2
commit
8270cb4103
|
@ -79,6 +79,7 @@
|
||||||
"nodemailer": "~1.3.0",
|
"nodemailer": "~1.3.0",
|
||||||
"object.assign": "^3.0.0",
|
"object.assign": "^3.0.0",
|
||||||
"passport-facebook": "^2.0.0",
|
"passport-facebook": "^2.0.0",
|
||||||
|
"passport-github": "^0.1.5",
|
||||||
"passport-google-oauth2": "^0.1.6",
|
"passport-google-oauth2": "^0.1.6",
|
||||||
"passport-linkedin-oauth2": "^1.2.1",
|
"passport-linkedin-oauth2": "^1.2.1",
|
||||||
"passport-local": "^1.0.0",
|
"passport-local": "^1.0.0",
|
||||||
|
|
|
@ -127,5 +127,19 @@ module.exports = {
|
||||||
state: process.env.LINKEDIN_STATE
|
state: process.env.LINKEDIN_STATE
|
||||||
},
|
},
|
||||||
failureFlash: true
|
failureFlash: true
|
||||||
|
},
|
||||||
|
'github-login': {
|
||||||
|
provider: 'github',
|
||||||
|
authScheme: 'oauth2',
|
||||||
|
module: 'passport-github',
|
||||||
|
authPath: '/auth/github',
|
||||||
|
callbackURL: '/auth/github/callback',
|
||||||
|
callbackPath: '/auth/github/callback',
|
||||||
|
successRedirect: successRedirect,
|
||||||
|
failureRedirect: failureRedirect,
|
||||||
|
clientID: process.env.GITHUB_ID,
|
||||||
|
clientSecret: process.env.GITHUB_SECRET,
|
||||||
|
scope: ['email'],
|
||||||
|
failureFlash: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,18 +2,21 @@ extends ../layout
|
||||||
block content
|
block content
|
||||||
.jumbotron.text-center
|
.jumbotron.text-center
|
||||||
h2 Sign in with one of these options:
|
h2 Sign in with one of these options:
|
||||||
a.btn.btn-lg.btn-block.btn-google-plus.btn-social(href='/auth/google')
|
a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/github')
|
||||||
i.fa.fa-google-plus
|
i.fa.fa-github
|
||||||
| Sign in with Google
|
| Sign in with Github
|
||||||
a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook')
|
|
||||||
i.fa.fa-facebook
|
|
||||||
| Sign in with Facebook
|
|
||||||
a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin')
|
|
||||||
i.fa.fa-linkedin
|
|
||||||
| Sign in with LinkedIn
|
|
||||||
a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
a.btn.btn-lg.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
||||||
i.fa.fa-twitter
|
i.fa.fa-twitter
|
||||||
| Sign in with Twitter
|
| Sign in with Twitter
|
||||||
|
a.btn.btn-lg.btn-block.btn-facebook.btn-social(href='/auth/facebook')
|
||||||
|
i.fa.fa-facebook
|
||||||
|
| Sign in with Facebook
|
||||||
|
a.btn.btn-lg.btn-block.btn-google-plus.btn-social(href='/auth/google')
|
||||||
|
i.fa.fa-google-plus
|
||||||
|
| Sign in with Google
|
||||||
|
a.btn.btn-lg.btn-block.btn-linkedin.btn-social(href='/auth/linkedin')
|
||||||
|
i.fa.fa-linkedin
|
||||||
|
| Sign in with LinkedIn
|
||||||
br
|
br
|
||||||
p
|
p
|
||||||
a(href="/email-signup") Or sign up using your email address here.
|
a(href="/email-signup") Or sign up using your email address here.
|
||||||
|
|
Loading…
Reference in New Issue