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;