forked from f0ck/f0ckv2
a
This commit is contained in:
parent
69ca852379
commit
9da30ac7d2
@ -221,14 +221,14 @@ export default new class {
|
||||
return next();
|
||||
};
|
||||
|
||||
// async loggedin(req, res, next) {
|
||||
// if(!req.session) {
|
||||
// return res.reply({
|
||||
// code: 401,
|
||||
// body: "401 - Unauthorized"
|
||||
// });
|
||||
// }
|
||||
// return next();
|
||||
// };
|
||||
async loggedin(req, res, next) {
|
||||
if(!req.session) {
|
||||
return res.reply({
|
||||
code: 401,
|
||||
body: "401 - Unauthorized"
|
||||
});
|
||||
}
|
||||
return next();
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -3,7 +3,7 @@ import lib from "../lib.mjs";
|
||||
import f0cklib from "../routeinc/f0cklib.mjs";
|
||||
|
||||
export default (router, tpl) => {
|
||||
router.get(/^\/random$/, lib.loggedin, async (req, res) => {
|
||||
router.get(/^\/random$/, async (req, res) => {
|
||||
let referer = req.headers.referer ?? '';
|
||||
let opts = {};
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
import db from "../../inc/sql.mjs";
|
||||
import cfg from "../../inc/config.mjs";
|
||||
import lib from "../../inc/lib.mjs";
|
||||
import f0cklib from "../routeinc/f0cklib.mjs";
|
||||
|
||||
export default (router, tpl) => {
|
||||
router.get(/^\/tags$/, async (req, res) => {
|
||||
router.get(/^\/tags$/,lib.loggedin, async (req, res) => {
|
||||
|
||||
const phrase = cfg.websrv.phrases[~~(Math.random() * cfg.websrv.phrases.length)];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user