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-04 15:20:12 +03:00
parent 45946e7c8e
commit 712af0c898
14 changed files with 85 additions and 18 deletions

View File

@@ -27,6 +27,8 @@ export const createLoopJob = async (
allowIp: string;
targetLoops: number;
delayMs: number;
profileName?: string;
profileId?: string;
}
): Promise<LoopJob> => {
const now = nowIso();
@@ -41,6 +43,8 @@ export const createLoopJob = async (
targetLoops: input.targetLoops,
doneLoops: 0,
delayMs: input.delayMs,
profileName: input.profileName,
profileId: input.profileId,
deleteDataBetweenLoops: true,
enforcementMode: "aggressive-soft",
status: "RUNNING",

View File

@@ -18,7 +18,7 @@ router.post("/start", async (req, res) => {
if (!parsed.success) {
return res.status(400).json({ error: parsed.error.flatten() });
}
const { hash, allowIp, targetLoops, delayMs } = parsed.data;
const { hash, allowIp, targetLoops, delayMs, profileName, profileId } = parsed.data;
const db = await readDb();
if (targetLoops > db.settings.maxLoopLimit) {
return res.status(400).json({ error: "Target loops exceed max limit" });
@@ -64,6 +64,8 @@ router.post("/start", async (req, res) => {
allowIp,
targetLoops,
delayMs,
profileName,
profileId,
});
res.json(job);
});