Auth Route

mail@pastecode.io avatar
unknown
javascript
7 months ago
557 B
8
Indexable
Never
import express from 'express';
import passport from 'passport';
import { AuthController } from '../controllers/authController.js';

const router = express.Router();

router.get('/google', passport.authenticate('google'), (req, res) => {
  res.send('Google Auth');
});
router.get('/google/redirect', passport.authenticate('google', { failureRedirect: '/' }), (req, res) => {
  res.status(200).send('Google Redirect');
});

router.post('/register', AuthController.register);
router.post('/login', AuthController.login);

export default router;