Feat(medusa, user, core-flows): User creation with invites (#6413)
**What** - add accept invite endpoint **Invite accept flow** - authenticate using the auth endpoint to create and auth-user - invoke accept endpoint with token and info to create user
This commit is contained in:
1 parent
5977a38ef4
commit
f6d38163bb
28 files changed
+399
-40
No files matched your search
@@ -15,6 +15,7 @@ export interface CreateInviteDTO {
|
||||
metadata?: Record<string, unknown> | null
|
||||
}
|
||||
|
||||
export interface UpdateInviteDTO extends Partial<CreateInviteDTO> {
|
||||
export interface UpdateInviteDTO
|
||||
extends Partial<Omit<CreateInviteDTO, "email">> {
|
||||
id: string
|
||||
}
|
||||
@@ -12,6 +12,11 @@ import { IModuleService } from "../modules-sdk"
|
||||
import { RestoreReturn, SoftDeleteReturn } from "../dal"
|
||||
|
||||
export interface IUserModuleService extends IModuleService {
|
||||
validateInviteToken(
|
||||
token: string,
|
||||
sharedContext?: Context
|
||||
): Promise<InviteDTO>
|
||||
|
||||
retrieve(
|
||||
id: string,
|
||||
config?: FindConfig<UserDTO>,
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
export interface AcceptInviteWorkflowInputDTO {
|
||||
invite_token: string
|
||||
auth_user_id: string
|
||||
user: {
|
||||
first_name?: string | null
|
||||
last_name?: string | null
|
||||
avatar_url?: string | null
|
||||
metadata?: Record<string, unknown> | null
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from "./create-invite"
|
||||
export * from "./update-invite"
|
||||
export * from "./delete-invite"
|
||||
export * from "./accept-invite"
|
||||
@@ -1,5 +0,0 @@
|
||||
import { UpdateInviteDTO } from "../../user"
|
||||
|
||||
export interface UpdateInvitesWorkflowInputDTO {
|
||||
updates: UpdateInviteDTO[]
|
||||
}
|
||||
Reference in new issue
Block a user