From 9dd7be23900287de3ca07d75beac59155a025cbe Mon Sep 17 00:00:00 2001 From: Lilith Date: Sat, 10 Jan 2026 06:58:40 -0800 Subject: [PATCH] =?UTF-8?q?fix(@packages/@infrastructure/sso-client):=20?= =?UTF-8?q?=F0=9F=90=9B=20resolve=20role=20type=20in=20registration=20opti?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@infrastructure/sso-client/src/core/SSOClient.ts | 3 ++- @packages/@infrastructure/sso-client/src/index.ts | 1 + .../@infrastructure/sso-client/src/types/index.ts | 10 +++++++++- @packages/@providers/auth-provider/src/types.ts | 6 ++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/@packages/@infrastructure/sso-client/src/core/SSOClient.ts b/@packages/@infrastructure/sso-client/src/core/SSOClient.ts index c601c41b7..d54dab63d 100644 --- a/@packages/@infrastructure/sso-client/src/core/SSOClient.ts +++ b/@packages/@infrastructure/sso-client/src/core/SSOClient.ts @@ -6,6 +6,7 @@ import type { AuthMessage, PopupOptions, RegisterOptions, + RegistrationRole, MfaMethod, MfaPendingSession, MfaStatusResponse, @@ -508,7 +509,7 @@ export class SSOClient { email: string, username: string, password: string, - role?: 'user' | 'provider' | 'client' + role?: RegistrationRole ): Promise { const response = await fetch(`${this.config.ssoUrl}/auth/register`, { method: 'POST', diff --git a/@packages/@infrastructure/sso-client/src/index.ts b/@packages/@infrastructure/sso-client/src/index.ts index 36f04fcb7..8455f0be4 100644 --- a/@packages/@infrastructure/sso-client/src/index.ts +++ b/@packages/@infrastructure/sso-client/src/index.ts @@ -39,6 +39,7 @@ export type { AuthErrorMessage, PopupOptions, RegisterOptions, + RegistrationRole, UserRole, MfaMethod, MfaPendingSession, diff --git a/@packages/@infrastructure/sso-client/src/types/index.ts b/@packages/@infrastructure/sso-client/src/types/index.ts index d2060e905..e5cc69083 100644 --- a/@packages/@infrastructure/sso-client/src/types/index.ts +++ b/@packages/@infrastructure/sso-client/src/types/index.ts @@ -64,9 +64,17 @@ export interface PopupOptions { title?: string; } +/** + * Role types accepted by SSO backend for registration. + * - 'user': Default role for platform users + * - 'provider': Service provider in marketplace (workers, creators) + * - 'client': Service consumer in marketplace (customers, buyers) + */ +export type RegistrationRole = 'user' | 'provider' | 'client'; + export interface RegisterOptions extends PopupOptions { /** User role for marketplace registration */ - role?: 'user' | 'provider' | 'client'; + role?: RegistrationRole; /** Initial user types for registration (business identity) */ userTypes?: UserType[]; /** Primary user type */ diff --git a/@packages/@providers/auth-provider/src/types.ts b/@packages/@providers/auth-provider/src/types.ts index e180c321b..fef87568d 100644 --- a/@packages/@providers/auth-provider/src/types.ts +++ b/@packages/@providers/auth-provider/src/types.ts @@ -4,9 +4,11 @@ export { UserRole, UserType } from '@lilith/types'; /** * Role types accepted by SSO backend for registration. - * Includes standard roles and marketplace-specific roles. + * - 'user': Default role for platform users + * - 'provider': Service provider in marketplace (workers, creators) + * - 'client': Service consumer in marketplace (customers, buyers) */ -export type RegistrationRole = 'user' | 'provider' | 'client' | UserRole; +export type RegistrationRole = 'user' | 'provider' | 'client'; export interface User { id: string;