File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11import passport from 'passport' ;
22
33export default {
4+ setupError : ( req , res ) => {
5+ res . send (
6+ 'Please setup and turn on `passportStrategy.<social provider>` ' +
7+ 'of config file `configs/project/server.js`'
8+ ) ;
9+ } ,
410 initFacebook : ( req , res , next ) => (
511 passport . authenticate ( 'facebook' , {
612 scope : [ 'public_profile' , 'email' ] ,
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ export default ({ app }) => {
1111 passportAuth ( 'facebook' ) ,
1212 userController . socialLogin
1313 ) ;
14+ } else {
15+ app . get ( '/auth/facebook' , socialAuthController . setupError ) ;
1416 }
1517 // linkedin
1618 if ( configs . passportStrategy . linkedin ) {
@@ -19,5 +21,7 @@ export default ({ app }) => {
1921 passportAuth ( 'linkedin' ) ,
2022 userController . socialLogin
2123 ) ;
24+ } else {
25+ app . get ( '/auth/linkedin' , socialAuthController . setupError ) ;
2226 }
2327} ;
You can’t perform that action at this time.
0 commit comments