fix(auth): fence temporary Stage credentials by account generation

This commit is contained in:
devops authored and devops committed 2026-10-24 13:04:35 +00:00
1 parent e036c5d436
commit 80a2e188cf
6 files changed
+48 -5

No files matched your search

+2 -1
View File
@@ -63,6 +63,7 @@ export class CouponInput {
import { ALLOWED_USER_ROLES, assertUserMutationAllowed } from "./user-role-policy";
import type { UserAdminActor } from "./user-role-policy";
import { randomUUID } from "crypto";
import { authorizeStageSession, STAGE_TEST_ID, STAGE_TEST_EMAIL, STAGE_TEST_MOBILE } from "../auth/stage-test-principal";
@Injectable()
@@ -274,7 +275,7 @@ export class AdminService {
return this.prisma.user.create({
data: {
...(stage ? { id: STAGE_TEST_ID, stageTestSession: stage.session, authExpiresAt: stage.expiresAt } : {}),
...(stage ? { id: STAGE_TEST_ID, stageTestGeneration:randomUUID(), stageTestSession: stage.session, authExpiresAt: stage.expiresAt } : {}),
firstName: dto.firstName.trim(),
lastName: dto.lastName.trim(),
mobile,