File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
import passport from 'passport' ;
2
2
3
3
export 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
+ } ,
4
10
initFacebook : ( req , res , next ) => (
5
11
passport . authenticate ( 'facebook' , {
6
12
scope : [ 'public_profile' , 'email' ] ,
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ export default ({ app }) => {
11
11
passportAuth ( 'facebook' ) ,
12
12
userController . socialLogin
13
13
) ;
14
+ } else {
15
+ app . get ( '/auth/facebook' , socialAuthController . setupError ) ;
14
16
}
15
17
// linkedin
16
18
if ( configs . passportStrategy . linkedin ) {
@@ -19,5 +21,7 @@ export default ({ app }) => {
19
21
passportAuth ( 'linkedin' ) ,
20
22
userController . socialLogin
21
23
) ;
24
+ } else {
25
+ app . get ( '/auth/linkedin' , socialAuthController . setupError ) ;
22
26
}
23
27
} ;
You can’t perform that action at this time.
0 commit comments