fix(@packages/@infrastructure/sso-client): 🐛 resolve role type in registration options
This commit is contained in:
parent
c7a51e6aec
commit
9dd7be2390
4 changed files with 16 additions and 4 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ export type {
|
|||
AuthErrorMessage,
|
||||
PopupOptions,
|
||||
RegisterOptions,
|
||||
RegistrationRole,
|
||||
UserRole,
|
||||
MfaMethod,
|
||||
MfaPendingSession,
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue