mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-13 17:29:42 +00:00
handled error cases for external auth login
This commit is contained in:
@@ -5,18 +5,18 @@ import { oauthController } from '../../controllers/v1';
|
||||
import { authLimiter } from '../../helpers/rateLimiter';
|
||||
|
||||
router.get(
|
||||
'/redirect/google',
|
||||
authLimiter,
|
||||
passport.authenticate('google', {
|
||||
scope: ['profile', 'email'],
|
||||
session: false,
|
||||
}),
|
||||
)
|
||||
|
||||
'/redirect/google',
|
||||
authLimiter,
|
||||
passport.authenticate('google', {
|
||||
scope: ['profile', 'email'],
|
||||
session: false,
|
||||
}),
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/callback/google',
|
||||
passport.authenticate('google', { failureRedirect: '/error', session: false }),
|
||||
oauthController.handleAuthProviderCallback,
|
||||
'/callback/google',
|
||||
passport.authenticate('google', { failureRedirect: '/login/provider/error', session: false }),
|
||||
oauthController.handleAuthProviderCallback,
|
||||
)
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -106,7 +106,7 @@ const initializePassport = async () => {
|
||||
req.providerAuthToken = providerAuthToken;
|
||||
cb(null, profile);
|
||||
} catch (err) {
|
||||
cb(err);
|
||||
cb(null, false);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user