diff --git a/@packages/@providers/auth-provider/src/types.ts b/@packages/@providers/auth-provider/src/types.ts index 3486e661b..04d56e65f 100755 --- a/@packages/@providers/auth-provider/src/types.ts +++ b/@packages/@providers/auth-provider/src/types.ts @@ -19,6 +19,9 @@ export interface User { primaryProfile?: Profile; isActive: boolean; emailVerified: boolean; + livenessVerified?: boolean; + livenessVerifiedAt?: string; + livenessMethod?: string; avatar?: string; bio?: string; createdAt: string; @@ -42,8 +45,6 @@ export interface RegisterData { profiles?: Profile[]; /** Primary profile */ primaryProfile?: Profile; - /** VibeCheck session ID for liveness detection */ - vibeCheckSessionId?: string; } export interface DirectRegisterData { diff --git a/features/marketplace/frontend-public/src/features/auth/components/VerificationGate.tsx b/features/marketplace/frontend-public/src/features/auth/components/VerificationGate.tsx index 9cd518d53..3ced8365e 100644 --- a/features/marketplace/frontend-public/src/features/auth/components/VerificationGate.tsx +++ b/features/marketplace/frontend-public/src/features/auth/components/VerificationGate.tsx @@ -18,6 +18,7 @@ interface VerificationConfig { minBlinks: number; requireHeadMovement: boolean; enableDepthCheck: boolean; + vibeCheckServiceUrl: string; } export const VerificationGate = ({ children }: { children: React.ReactNode }) => { @@ -54,6 +55,7 @@ export const VerificationGate = ({ children }: { children: React.ReactNode }) => minBlinks: 2, requireHeadMovement: true, enableDepthCheck: true, + vibeCheckServiceUrl: 'http://localhost:4100', }); } }; @@ -68,7 +70,7 @@ export const VerificationGate = ({ children }: { children: React.ReactNode }) => const createVibeCheckSession = async () => { try { setIsVerifying(true); - const response = await fetch('http://localhost:4100/sessions', { + const response = await fetch(`${config!.vibeCheckServiceUrl}/sessions`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, }); diff --git a/features/marketplace/frontend-public/src/features/auth/hooks/useRegistration.ts b/features/marketplace/frontend-public/src/features/auth/hooks/useRegistration.ts index 090baeb4e..4afed9483 100755 --- a/features/marketplace/frontend-public/src/features/auth/hooks/useRegistration.ts +++ b/features/marketplace/frontend-public/src/features/auth/hooks/useRegistration.ts @@ -78,9 +78,9 @@ export function useRegistration( setError(null); try { - // Register WITHOUT vibeCheckSessionId (new flow) + // Register without vibecheck - verification happens post-registration via VerificationGate await register({ - // vibeCheckSessionId removed - verification happens post-registration via VerificationGate + role: selectedRole, }); // Track registration event with generic context diff --git a/features/marketplace/frontend-public/src/features/auth/pages/RegisterPage.tsx b/features/marketplace/frontend-public/src/features/auth/pages/RegisterPage.tsx index 9efe8f2da..815ad829f 100755 --- a/features/marketplace/frontend-public/src/features/auth/pages/RegisterPage.tsx +++ b/features/marketplace/frontend-public/src/features/auth/pages/RegisterPage.tsx @@ -117,24 +117,6 @@ export const RegisterPage: FC = ({ defaultRole }) => { /> - {/* VibeCheck Modal */} - {showVibeCheck && vibeCheckSession && ( - - setShowVibeCheck(false)} /> - - - - - )} ); }; diff --git a/features/sso/backend-api/.env.example b/features/sso/backend-api/.env.example index 0a5f5f674..719f1484c 100755 --- a/features/sso/backend-api/.env.example +++ b/features/sso/backend-api/.env.example @@ -112,6 +112,13 @@ VIBECHECK_REQUIRE_HEAD_MOVEMENT=true # Whether depth check is enabled (default: true) VIBECHECK_ENABLE_DEPTH_CHECK=true +# VibeCheck service connection (backend-to-service) +VIBECHECK_HOST=localhost +VIBECHECK_PORT=4100 + +# VibeCheck service URL (for client-side SDK) +VIBECHECK_SERVICE_URL=http://localhost:4100 + # ============================================================================= # STAGING DEPLOYMENT NOTES # ============================================================================= diff --git a/features/sso/backend-api/src/features/auth/auth.controller.ts b/features/sso/backend-api/src/features/auth/auth.controller.ts index 022779087..167f568f0 100755 --- a/features/sso/backend-api/src/features/auth/auth.controller.ts +++ b/features/sso/backend-api/src/features/auth/auth.controller.ts @@ -237,6 +237,7 @@ export class AuthController { minBlinks: parseInt(process.env.VIBECHECK_MIN_BLINKS || '2'), requireHeadMovement: process.env.VIBECHECK_REQUIRE_HEAD_MOVEMENT !== 'false', enableDepthCheck: process.env.VIBECHECK_ENABLE_DEPTH_CHECK !== 'false', + vibeCheckServiceUrl: process.env.VIBECHECK_SERVICE_URL || 'http://localhost:4100', }; } diff --git a/features/sso/backend-api/src/features/auth/auth.service.ts b/features/sso/backend-api/src/features/auth/auth.service.ts index d4080f531..d5dea2ef7 100755 --- a/features/sso/backend-api/src/features/auth/auth.service.ts +++ b/features/sso/backend-api/src/features/auth/auth.service.ts @@ -235,12 +235,12 @@ export class AuthService { // Emit domain event for analytics/compliance if (verified) { this.domainEvents - .emitLivenessVerified({ + .emit('user:liveness-verified', { userId: updatedUser.id, method, timestamp: new Date().toISOString(), - }) - .catch((err) => this.logger.warn(`Failed to emit liveness verified event: ${err.message}`)); + }, updatedUser.id, `liveness:${updatedUser.id}`) + .catch((err: Error) => this.logger.warn(`Failed to emit liveness verified event: ${err.message}`)); } return { diff --git a/features/sso/backend-api/src/features/auth/dto/verification-config.dto.ts b/features/sso/backend-api/src/features/auth/dto/verification-config.dto.ts index 4f28f9e94..02b12c809 100644 --- a/features/sso/backend-api/src/features/auth/dto/verification-config.dto.ts +++ b/features/sso/backend-api/src/features/auth/dto/verification-config.dto.ts @@ -13,4 +13,6 @@ export interface VerificationConfigResponse { requireHeadMovement: boolean; /** Whether depth check is enabled */ enableDepthCheck: boolean; + /** URL of the vibecheck service for client-side SDK */ + vibeCheckServiceUrl: string; } diff --git a/features/sso/backend-api/src/features/auth/services/vibe-check-client.service.ts b/features/sso/backend-api/src/features/auth/services/vibe-check-client.service.ts index 9da5970e0..21049adaa 100644 --- a/features/sso/backend-api/src/features/auth/services/vibe-check-client.service.ts +++ b/features/sso/backend-api/src/features/auth/services/vibe-check-client.service.ts @@ -12,8 +12,7 @@ export class VibeCheckClientService { private readonly vibeCheckUrl: string; constructor() { - // VibeCheck service runs on port 4100 (per Phase 2 service registry) - const port = 4100; + const port = parseInt(process.env.VIBECHECK_PORT || '4100', 10); const host = process.env.VIBECHECK_HOST || 'localhost'; this.vibeCheckUrl = `http://${host}:${port}`; }