@@ -11,20 +11,20 @@ module.exports = (app, passport) => {
1111 } ) ;
1212 } ) ;
1313
14- /***** Google ****/
15- // send to google to do the authentication
14+ /***** github ****/
15+ // send to github to do the authentication
1616 // profile gets us their basic information including their name
1717 // email gets their emails
18- app . get ( '/auth/google ' ,
18+ app . get ( '/auth/github ' ,
1919 passport . authenticate (
20- 'google ' ,
20+ 'github ' ,
2121 { scope : [ 'profile' , 'email' ] }
2222 )
2323 ) ;
2424
25- app . get ( '/auth/google /callback' ,
25+ app . get ( '/auth/github /callback' ,
2626 passport . authenticate (
27- 'google ' ,
27+ 'github ' ,
2828 {
2929 successRedirect : '/profile' ,
3030 failureRedirect : '/'
@@ -52,6 +52,27 @@ module.exports = (app, passport) => {
5252 }
5353 ) ) ;
5454
55+ /***** Github ****/
56+ // send to github to do the authentication
57+ // profile gets us their basic information including their name
58+ // email gets their emails
59+ app . get ( '/auth/github' ,
60+ passport . authenticate (
61+ 'github' ,
62+ { scope : [ 'profile' , 'email' ] }
63+ )
64+ ) ;
65+
66+ app . get ( '/auth/github/callback' ,
67+ passport . authenticate (
68+ 'github' ,
69+ {
70+ successRedirect : '/profile' ,
71+ failureRedirect : '/'
72+ }
73+ ) ) ;
74+
75+ // Logout common
5576 app . get ( '/logout' , ( req , res ) => {
5677 req . logout ( ) ;
5778 res . redirect ( '/' ) ;
0 commit comments