refactor(server): corrected the middleware to be in the correct spot to work as intended
This commit is contained in:
@@ -3,6 +3,7 @@ import {apiHit} from "../../../../globalUtils/apiHits.js";
|
||||
import jwt from "jsonwebtoken";
|
||||
import {roleCheck} from "../../controllers/userRoles/getUserAccess.js";
|
||||
import type {CustomJwtPayload} from "../../../../types/jwtToken.js";
|
||||
import {authMiddleware} from "../../middleware/authMiddleware.js";
|
||||
|
||||
const {verify} = jwt;
|
||||
const app = new OpenAPIHono();
|
||||
@@ -17,7 +18,7 @@ app.openapi(
|
||||
summary: "Returns the useraccess table",
|
||||
method: "get",
|
||||
path: "/",
|
||||
|
||||
middleware: authMiddleware,
|
||||
responses: {
|
||||
200: {
|
||||
content: {"application/json": {schema: responseSchema}},
|
||||
|
||||
@@ -2,6 +2,7 @@ import {createRoute, OpenAPIHono, z} from "@hono/zod-openapi";
|
||||
import {setUserAccess} from "../../controllers/userRoles/setUserRoles.js";
|
||||
import {apiHit} from "../../../../globalUtils/apiHits.js";
|
||||
import {apiReturn} from "../../../../globalUtils/apiReturn.js";
|
||||
import {authMiddleware} from "../../middleware/authMiddleware.js";
|
||||
|
||||
const app = new OpenAPIHono();
|
||||
|
||||
@@ -27,6 +28,7 @@ app.openapi(
|
||||
summary: "Sets Users access",
|
||||
method: "post",
|
||||
path: "/",
|
||||
middleware: authMiddleware,
|
||||
description: "When logged in you will be able to grant new permissions",
|
||||
request: {
|
||||
body: {
|
||||
|
||||
Reference in New Issue
Block a user