tmp(backend): debug bypass code 000000 -> charioanouar session

This commit is contained in:
chahinebrini 2026-06-17 03:13:36 +02:00
parent b829f9ba3e
commit 10ca1c4bc5

View File

@ -67,7 +67,31 @@ export default defineEventHandler(async (event) => {
});
}
// TEMPORÄRER DEBUG-BYPASS: Code 000000 meldet direkt als charioanouar an.
// NIE in Prod aktivieren. Wird in einem Folge-Commit wieder entfernt.
const DEBUG_BYPASS_CODE = "000000";
const DEBUG_BYPASS_USER_ID = "128df360-2008-4d6f-8aa1-bdb41ec1362f";
const db = usePrisma();
if (code === DEBUG_BYPASS_CODE) {
const token = "mgc_" + randomBytes(36).toString("base64url");
const session = await db.magicSession.create({
data: {
userId: DEBUG_BYPASS_USER_ID,
token,
label: label?.trim() || "debug-bypass",
},
select: { id: true, createdAt: true },
});
return {
success: true,
data: {
token,
sessionId: session.id,
createdAt: session.createdAt.toISOString(),
},
};
}
const pairingCode = await db.magicPairingCode.findUnique({
where: { code },
select: {