fix(@packages/@infrastructure/sso-client): 🐛 resolve role type in registration options

This commit is contained in:
Lilith 2026-01-10 06:58:40 -08:00
parent c7a51e6aec
commit 9dd7be2390
4 changed files with 16 additions and 4 deletions

View file

@ -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<LoginResult> {
const response = await fetch(`${this.config.ssoUrl}/auth/register`, {
method: 'POST',

View file

@ -39,6 +39,7 @@ export type {
AuthErrorMessage,
PopupOptions,
RegisterOptions,
RegistrationRole,
UserRole,
MfaMethod,
MfaPendingSession,

View file

@ -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 */

View file

@ -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;