feat(admin-next): Email password invite flow in admin 2.0 (#6821)

This commit is contained in:
Oli Juhl
2024-03-29 08:05:11 +01:00
committed by GitHub
parent 45c49e89f2
commit d97af91a8d
15 changed files with 453 additions and 20 deletions
@@ -5,6 +5,7 @@ import {
AuthenticatedMedusaRequest,
MedusaResponse,
} from "../../../../types/routing"
import { AdminPostInvitesInviteAcceptReq } from "../validators"
export const POST = async (
@@ -15,7 +16,7 @@ export const POST = async (
const moduleService: IUserModuleService = req.scope.resolve(
ModuleRegistrationName.USER
)
const user = moduleService.retrieve(req.auth.actor_id)
const user = await moduleService.retrieve(req.auth.actor_id)
res.status(200).json({ user })
return
}
@@ -27,6 +28,7 @@ export const POST = async (
} as InviteWorkflow.AcceptInviteWorkflowInputDTO
let users
try {
const { result } = await acceptInviteWorkflow(req.scope).run({ input })
users = result
@@ -109,7 +109,6 @@ export class AdminCreateInviteRequest {
*/
export class AdminPostInvitesInviteAcceptReq {
/**
* The invite's first name.
* If email is not passed, we default to using the email of the invite.
*/
@IsString()