Allow all users to generate AI text for posts

Change API endpoint `/api/ai/generate` from `requireAdmin` to `requireAuth` middleware and update OpenRouterService to use shared admin configuration instead of per-user config.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/tWDOGLP
This commit is contained in:
michaelschal committed 2025-10-14 13:58:28 +00:00
1 parent ec2e634956
commit f2672727b8
4 files changed
+12 -5

No files matched your search

+1 -1
View File
@@ -435,7 +435,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
});
// AI text generation
app.post("/api/ai/generate", requireAdmin, async (req, res) => {
app.post("/api/ai/generate", requireAuth, async (req, res) => {
try {
const user = req.user as User;
const userId = user.id;