mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 21:40:31 +00:00
moved oauth controller endpoints to auth
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
import { body } from 'express-validator';
|
||||
import passport from 'passport';
|
||||
import { requireAuth, validateRequest } from '../../middleware';
|
||||
import { authController } from '../../controllers/v1';
|
||||
import { authLimiter } from '../../helpers/rateLimiter';
|
||||
@@ -44,4 +45,20 @@ router.post(
|
||||
);
|
||||
|
||||
|
||||
|
||||
router.get(
|
||||
'/redirect/google',
|
||||
authLimiter,
|
||||
passport.authenticate('google', {
|
||||
scope: ['profile', 'email'],
|
||||
session: false,
|
||||
}),
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/callback/google',
|
||||
passport.authenticate('google', { failureRedirect: '/login/provider/error', session: false }),
|
||||
authController.handleAuthProviderCallback,
|
||||
)
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -16,7 +16,6 @@ import stripe from './stripe';
|
||||
import integration from './integration';
|
||||
import integrationAuth from './integrationAuth';
|
||||
import secretsFolder from './secretsFolder';
|
||||
import oauth from './oauth';
|
||||
|
||||
export {
|
||||
signup,
|
||||
@@ -30,7 +29,6 @@ export {
|
||||
membership,
|
||||
key,
|
||||
inviteOrg,
|
||||
oauth,
|
||||
secret,
|
||||
serviceToken,
|
||||
password,
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
import passport from 'passport';
|
||||
import { oauthController } from '../../controllers/v1';
|
||||
import { authLimiter } from '../../helpers/rateLimiter';
|
||||
|
||||
router.get(
|
||||
'/redirect/google',
|
||||
authLimiter,
|
||||
passport.authenticate('google', {
|
||||
scope: ['profile', 'email'],
|
||||
session: false,
|
||||
}),
|
||||
)
|
||||
|
||||
router.get(
|
||||
'/callback/google',
|
||||
passport.authenticate('google', { failureRedirect: '/login/provider/error', session: false }),
|
||||
oauthController.handleAuthProviderCallback,
|
||||
)
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user