revert revert feat(auth): bearer token desteği ve çoklu origin ayarı ekle

revert feat(auth): bearer token desteği ve çoklu origin ayarı ekle

- Authorization header ile Bearer token kimlik doğrulaması eklendi
- Token'ların localStorage'da saklanması desteği eklendi
- WEB_ALLOWED_ORIGINS ve WEB_ALLOWED_HOSTS konfigürasyonları eklendi
- Loop işlerinde profileId ve profileName alanları eklendi
- CORS ve Vite sunucusu için çoklu origin desteği sağlandı
This commit is contained in:
2026-01-05 17:34:03 +00:00
parent cdffa46a5b
commit 8bf4b10af3
14 changed files with 18 additions and 85 deletions

View File

@@ -2,10 +2,7 @@ import { Request, Response, NextFunction } from "express";
import { verifyToken } from "./auth.service"
export const requireAuth = (req: Request, res: Response, next: NextFunction) => {
const cookieToken = req.cookies?.["qbuffer_token"];
const authHeader = req.headers.authorization;
const bearer = authHeader?.startsWith("Bearer ") ? authHeader.slice(7) : undefined;
const token = cookieToken || bearer;
const token = req.cookies?.["qbuffer_token"];
if (!token) {
return res.status(401).json({ error: "Unauthorized" });
}