14 lines
474 B
JavaScript
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;
|