feat: Move userpass default definition to defineConfig instead of a hard-coded value (#8557)

This commit is contained in:
Stevche Radevski
2024-08-13 11:10:23 +02:00
committed by GitHub
parent fc439a32f1
commit a013c4edc5
7 changed files with 76 additions and 21 deletions

View File

@@ -1,5 +1,3 @@
import EmailPassProvider from "@medusajs/auth-emailpass"
import { LoaderOptions, ModulesSdkTypes, ModuleProvider } from "@medusajs/types"
import { Lifetime, asFunction, asValue } from "awilix"
import { moduleProviderLoader } from "@medusajs/modules-sdk"
@@ -33,18 +31,9 @@ export default async ({
| ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions
) & { providers: ModuleProvider[] }
>): Promise<void> => {
// Note: For now we want to inject some providers out of the box
const providerConfig = [
{
resolve: EmailPassProvider,
id: "emailpass",
},
...(options?.providers ?? []),
]
await moduleProviderLoader({
container,
providers: providerConfig,
providers: options?.providers || [],
registerServiceFn: registrationFn,
})
}