Skip to content

AuthModule

Module in @evolve-framework/medusa

Registration, sign-in and password recovery, served from Medusa's auth module.

Medusa keeps identity and profile apart: auth owns the credential and issues the token, customer owns the person. Registration therefore touches both, which is the one place this module reaches into the customer domain.

import { AuthModule } from "@evolve-framework/medusa/modules";

Serves the Authentication part of the GraphQL API: cartMergeUndo, createGuestSession, customerLogin, customerLogout, customerPasswordReset, customerPasswordResetRequest, customerPasswordUpdate, refreshToken.

new AuthModule(options?: AuthModuleOptions)
OptionTypeDescription
notifications?UserNotificationClient

Where the account-created and password-reset-complete notifications go, typically a QueuedUserNotificationClient from @evolve-framework/user-notifications. Without one none are published. The reset email itself is Medusa's to send.

clientFactory?ClientFactory

With it the module also serves POST /api/create-session, a guest session for a caller that needs one before its first GraphQL request, and POST /api/client-context, which RemoteClientContextLoader asks.

Extends AbstractModule<unknown>.

The same module on commercetools and sfcc.