Skip to content

Commit 813b089

Browse files
committed
Add hint for disabled social auth service
1 parent 5485067 commit 813b089

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/server/controllers/socialAuth.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import passport from 'passport';
22

33
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+
},
410
initFacebook: (req, res, next) => (
511
passport.authenticate('facebook', {
612
scope: ['public_profile', 'email'],

src/server/routes/socialAuth.js

+4
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)