imaginar/routes/authRoutes.js
2024-10-19 20:24:54 +09:00

14 lines
474 B
JavaScript

const express = require('express');
const passport = require('passport');
const router = express.Router();
const authController = require('../controllers/authController');
// Discord認証
router.get('/auth/discord', passport.authenticate('discord'));
router.get('/auth/discord/callback', passport.authenticate('discord', { failureRedirect: '/' }), authController.handleCallback);
// ログアウト
router.get('/logout', authController.logout);
module.exports = router;