diff --git a/www/apps/book/public/llms-full.txt b/www/apps/book/public/llms-full.txt index 84eb76afad..8c9f90f796 100644 --- a/www/apps/book/public/llms-full.txt +++ b/www/apps/book/public/llms-full.txt @@ -24900,7 +24900,7 @@ The Google Auth Module Provider allows you to authenticate users with their Goog ### Prerequisites - [Create a project in Google Cloud.](https://cloud.google.com/resource-manager/docs/creating-managing-projects) -- [Create authorization credentials. When setting the Redirect Uri, set it to a URL in your frontend that later uses Medusa's callback route to validate the authentication.](https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred) +- [Create Oauth client ID credentials. When setting the Redirect Uri, set it to a URL in your frontend (for example, storefront) that later uses Medusa's callback route to validate the authentication.](https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred) To use the Google Auth Module Provider, add the module to the array of providers passed to the Auth Module in your `medusa-config.ts`: @@ -24912,25 +24912,27 @@ import { Modules, ContainerRegistrationKeys } from "@medusajs/framework/utils" module.exports = defineConfig({ // ... modules: [ + // ... { - // ... - [Modules.AUTH]: { - resolve: "@medusajs/medusa/auth", - dependencies: [Modules.CACHE, ContainerRegistrationKeys.LOGGER], - options: { - providers: [ - // other providers... - { - resolve: "@medusajs/medusa/auth-google", - id: "google", - options: { - clientId: process.env.GOOGLE_CLIENT_ID, - clientSecret: process.env.GOOGLE_CLIENT_SECRET, - callbackUrl: process.env.GOOGLE_CALLBACK_URL, - }, + resolve: "@medusajs/medusa/auth", + dependencies: [Modules.CACHE, ContainerRegistrationKeys.LOGGER], + options: { + providers: [ + // other providers... + { + resolve: "@medusajs/medusa/auth-emailpass", + id: "emailpass", + }, + { + resolve: "@medusajs/medusa/auth-google", + id: "google", + options: { + clientId: process.env.GOOGLE_CLIENT_ID, + clientSecret: process.env.GOOGLE_CLIENT_SECRET, + callbackUrl: process.env.GOOGLE_CALLBACK_URL, }, - ], - }, + }, + ], }, }, ], @@ -45033,7 +45035,7 @@ For admin customizations, create this file at `src/admin/lib/config.ts`. ### Admin (Medusa project) -```ts title="src/admin/lib/config.ts" +```ts title="src/admin/lib/sdk.ts" import Medusa from "@medusajs/js-sdk" export const sdk = new Medusa({ @@ -45047,7 +45049,7 @@ export const sdk = new Medusa({ ### Admin (Medusa Plugin) -```ts title="src/admin/lib/config.ts" +```ts title="src/admin/lib/sdk.ts" import Medusa from "@medusajs/js-sdk" export const sdk = new Medusa({ @@ -45061,7 +45063,7 @@ export const sdk = new Medusa({ ### Storefront -```ts title="config.ts" +```ts title="sdk.ts" import Medusa from "@medusajs/js-sdk" let MEDUSA_BACKEND_URL = "http://localhost:9000" diff --git a/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx index a559c89a39..475c72c910 100644 --- a/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx @@ -19,7 +19,7 @@ The Google Auth Module Provider allows you to authenticate users with their Goog link: "https://cloud.google.com/resource-manager/docs/creating-managing-projects" }, { - text: "Create authorization credentials. When setting the Redirect Uri, set it to a URL in your frontend that later uses Medusa's callback route to validate the authentication.", + text: "Create Oauth client ID credentials. When setting the Redirect Uri, set it to a URL in your frontend (for example, storefront) that later uses Medusa's callback route to validate the authentication.", link: "https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred" } ]} @@ -35,25 +35,27 @@ import { Modules, ContainerRegistrationKeys } from "@medusajs/framework/utils" module.exports = defineConfig({ // ... modules: [ + // ... { - // ... - [Modules.AUTH]: { - resolve: "@medusajs/medusa/auth", - dependencies: [Modules.CACHE, ContainerRegistrationKeys.LOGGER], - options: { - providers: [ - // other providers... - { - resolve: "@medusajs/medusa/auth-google", - id: "google", - options: { - clientId: process.env.GOOGLE_CLIENT_ID, - clientSecret: process.env.GOOGLE_CLIENT_SECRET, - callbackUrl: process.env.GOOGLE_CALLBACK_URL, - }, + resolve: "@medusajs/medusa/auth", + dependencies: [Modules.CACHE, ContainerRegistrationKeys.LOGGER], + options: { + providers: [ + // other providers... + { + resolve: "@medusajs/medusa/auth-emailpass", + id: "emailpass", + }, + { + resolve: "@medusajs/medusa/auth-google", + id: "google", + options: { + clientId: process.env.GOOGLE_CLIENT_ID, + clientSecret: process.env.GOOGLE_CLIENT_SECRET, + callbackUrl: process.env.GOOGLE_CALLBACK_URL, }, - ], - }, + }, + ], }, }, ], diff --git a/www/apps/resources/app/js-sdk/page.mdx b/www/apps/resources/app/js-sdk/page.mdx index d8e674af94..1da2868fbe 100644 --- a/www/apps/resources/app/js-sdk/page.mdx +++ b/www/apps/resources/app/js-sdk/page.mdx @@ -44,7 +44,7 @@ For admin customizations, create this file at `src/admin/lib/config.ts`. -```ts title="src/admin/lib/config.ts" +```ts title="src/admin/lib/sdk.ts" import Medusa from "@medusajs/js-sdk" export const sdk = new Medusa({ @@ -59,7 +59,7 @@ export const sdk = new Medusa({ -```ts title="src/admin/lib/config.ts" +```ts title="src/admin/lib/sdk.ts" import Medusa from "@medusajs/js-sdk" export const sdk = new Medusa({ @@ -74,7 +74,7 @@ export const sdk = new Medusa({ -```ts title="config.ts" +```ts title="sdk.ts" import Medusa from "@medusajs/js-sdk" let MEDUSA_BACKEND_URL = "http://localhost:9000"