system now uses seperate pricing.
All checks were successful
Build Frontend / Build Frontend (push) Successful in 8s
All checks were successful
Build Frontend / Build Frontend (push) Successful in 8s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { authenticate, isAdmin } from "../middleware/auth.js";
|
||||
import { authenticate } from "../middleware/auth.js";
|
||||
import pricingService from "../services/pricing.js";
|
||||
import Item from "../models/Item.js";
|
||||
import MarketPrice from "../models/MarketPrice.js";
|
||||
@@ -20,17 +20,13 @@ export default async function adminRoutes(fastify, options) {
|
||||
});
|
||||
}
|
||||
|
||||
// Check if user is admin (you can customize this check)
|
||||
// For now, checking if user has admin role or specific steamId
|
||||
const adminSteamIds = process.env.ADMIN_STEAM_IDS?.split(",") || [];
|
||||
|
||||
if (
|
||||
!request.user.isAdmin &&
|
||||
!adminSteamIds.includes(request.user.steamId)
|
||||
) {
|
||||
// Check if user has admin staff level (3 or higher)
|
||||
if (!request.user.staffLevel || request.user.staffLevel < 3) {
|
||||
return reply.status(403).send({
|
||||
success: false,
|
||||
message: "Admin access required",
|
||||
requiredLevel: 3,
|
||||
currentLevel: request.user.staffLevel || 0,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user