2023-02-26 15:18:26 +01:00
|
|
|
const express = require('express');
|
|
|
|
const router = express.Router();
|
|
|
|
|
2023-03-19 10:10:05 +01:00
|
|
|
const base = require('js-base64');
|
|
|
|
|
2023-02-26 15:18:26 +01:00
|
|
|
const cookie_parse = require('cookie-parser');
|
|
|
|
const cookie_encrypt = require('cookie-encrypter');
|
|
|
|
|
2023-03-19 10:18:14 +01:00
|
|
|
const APP_KEY = Buffer.from(process.env.APP_KEY, 'base64').toString('ascii');
|
2023-02-26 15:18:26 +01:00
|
|
|
|
2023-03-19 10:10:05 +01:00
|
|
|
router.use(cookie_parse(APP_KEY));
|
2023-02-26 15:18:26 +01:00
|
|
|
router.use(cookie_encrypt(APP_KEY));
|
|
|
|
|
|
|
|
module.exports = router
|