a
This commit is contained in:
		@@ -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)];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user