First commit

This commit is contained in:
2026-01-15 14:12:41 +09:00
commit b28238cfd3
15 changed files with 1949 additions and 0 deletions

20
sso-demo/routes/index.js Normal file
View File

@@ -0,0 +1,20 @@
const express = require('express');
const router = express.Router();
// GET home page
router.get('/', (req, res, next) => {
// The ssoHandler middleware has already attached the user to res.locals
res.render('index', { user: res.locals.user });
});
// GET logout
router.get('/logout', (req, res, next) => {
req.session.destroy((err) => {
if (err) {
return next(err);
}
res.redirect('/');
});
});
module.exports = router;