docs: clarify how to use token in Auth Provider guide (#13759)
* docs: clarify how to use token in Auth Provider guide * small fix
This commit is contained in:
@@ -838,7 +838,7 @@ export const generatedEditDates = {
|
||||
"references/auth/IAuthModuleService/methods/auth.IAuthModuleService.authenticate/page.mdx": "2025-01-07T12:54:18.941Z",
|
||||
"references/auth/IAuthModuleService/methods/auth.IAuthModuleService.validateCallback/page.mdx": "2025-01-07T12:54:18.948Z",
|
||||
"references/auth/interfaces/auth.AuthenticationResponse/page.mdx": "2024-12-09T13:21:36.233Z",
|
||||
"references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx": "2025-05-20T07:51:40.736Z",
|
||||
"references/auth_provider/classes/auth_provider.AbstractAuthModuleProvider/page.mdx": "2025-10-15T15:45:41.565Z",
|
||||
"references/core_flows/Invite/Workflows_Invite/functions/core_flows.Invite.Workflows_Invite.refreshInviteTokensWorkflow/page.mdx": "2025-09-18T17:04:39.919Z",
|
||||
"references/types/CommonTypes/types/types.CommonTypes.BatchMethodResponse/page.mdx": "2024-12-09T13:21:32.849Z",
|
||||
"references/types/HttpTypes/interfaces/types.HttpTypes.AdminAddReturnShipping/page.mdx": "2025-04-11T09:04:47.540Z",
|
||||
|
||||
@@ -532,16 +532,18 @@ module.exports = defineConfig({
|
||||
|
||||
To test out your Authentication Module Provider, use any of the [Authentication Routes](https://docs.medusajs.com/resources/commerce-modules/auth/authentication-route), using your provider's ID as a path parameter.
|
||||
|
||||
For example, to get a registration token for an admin user, send a `POST` request to `/auth/user/my-auth/register` replacing `my-auth` with your Authentication Module Provider's ID:
|
||||
For example, to get a registration token for a customer, send a `POST` request to `/auth/customer/my-auth/register` replacing `my-auth` with your Authentication Module Provider's ID:
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:9000/auth/user/my-auth/register
|
||||
curl -X POST http://localhost:9000/auth/customer/my-auth/register
|
||||
-H 'Content-Type: application/json' --data-raw '{
|
||||
"email": "Whitney_Schultz@gmail.com",
|
||||
"password": "supersecret"
|
||||
}'
|
||||
```
|
||||
|
||||
Change the request body to pass the data required for your Authentication Module Provider to register the user.
|
||||
Change the request body to pass the data required for your Authentication Module Provider to register the customer.
|
||||
|
||||
If registration is successful, the response will have a `token` property.
|
||||
|
||||
You can then use the token to create a customer by sending a request to the [Create Customer API route](https://docs.medusajs.com/api/store#customers_postcustomers).
|
||||
|
||||
@@ -121,10 +121,10 @@ module.exports = defineConfig({
|
||||
|
||||
To test out your Authentication Module Provider, use any of the [Authentication Routes](https://docs.medusajs.com/resources/commerce-modules/auth/authentication-route), using your provider's ID as a path parameter.
|
||||
|
||||
For example, to get a registration token for an admin user, send a \`POST\` request to \`/auth/user/my-auth/register\` replacing \`my-auth\` with your Authentication Module Provider's ID:
|
||||
For example, to get a registration token for a customer, send a \`POST\` request to \`/auth/customer/my-auth/register\` replacing \`my-auth\` with your Authentication Module Provider's ID:
|
||||
|
||||
\`\`\`bash
|
||||
curl -X POST http://localhost:9000/auth/user/my-auth/register
|
||||
curl -X POST http://localhost:9000/auth/customer/my-auth/register
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"email": "Whitney_Schultz@gmail.com",
|
||||
@@ -132,9 +132,11 @@ curl -X POST http://localhost:9000/auth/user/my-auth/register
|
||||
}'
|
||||
\`\`\`
|
||||
|
||||
Change the request body to pass the data required for your Authentication Module Provider to register the user.
|
||||
Change the request body to pass the data required for your Authentication Module Provider to register the customer.
|
||||
|
||||
If registration is successful, the response will have a \`token\` property.
|
||||
|
||||
You can then use the token to create a customer by sending a request to the [Create Customer API route](https://docs.medusajs.com/api/store#customers_postcustomers).
|
||||
`,
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user