docs: edits and fixes to commerce module docs (#7468)

Apply edits and fixes to the commerce modules docs
This commit is contained in:
Shahed Nasser
2024-05-29 11:08:06 +00:00
committed by GitHub
parent 130de74d6d
commit 2c5ba408d4
160 changed files with 6400 additions and 3790 deletions
@@ -12,7 +12,7 @@ In this document, you'll learn about how the Auth Provider is used in an authent
## How to Authenticate a User
To authenticate a user, you use the `authenticate` method of the Auth Module's main service (`IAuthModuleService`). For example:
To authenticate a user, you use the [authenticate method of the Auth Module's main service](/references/auth/authenticate) (`IAuthModuleService`). For example:
```ts
const data = await authModuleService.authenticate(
@@ -24,13 +24,7 @@ const data = await authModuleService.authenticate(
)
```
This method calls the `authenticate` method of the specified provider and returns its data.
<Note>
Learn about the parameters and return type of the `IAuthModuleService`'s `authenticate` method in [this reference](/references/auth/authenticate).
</Note>
This method calls the `authenticate` method of the provider specified in the first parameter and returns its data.
---
@@ -51,7 +45,7 @@ Then, the user is authenticated successfully, and their authentication details a
<Note>
Learn more about the `authIdentity` in [this guide](../persisting-auth-user/page.mdx#what-is-an-authuser).
Check out the [AuthIdentity](/references/auth/models/AuthIdentity) reference for the expected fields in `authIdentity`.
</Note>
@@ -65,8 +59,8 @@ If the `authenticate` method returns the following object:
```ts
data = {
success: true,
location: "https://....",
success: true,
location: "https://....",
}
```
@@ -78,7 +72,7 @@ It means the authentication process requires the user to perform an action with
Providers handling this authentication flow must implement the `validateCallback` method. It implements the logic to validate the authentication with the third-party service.
So, once the user performs the required action, the third-party service must redirect to an API route that uses the `validateCallback` method of the `IAuthModuleService`. The method calls the specified providers `validateCallback` method passing it the authentication details it received in the second parameter:
So, once the user performs the required action, the third-party service must redirect to an API route that uses the [validateCallback method of the Auth Module's main service](/references/auth/validateCallback). The method calls the specified providers `validateCallback` method passing it the authentication details it received in the second parameter:
```ts
const data = await authModuleService.validateCallback(
@@ -90,13 +84,7 @@ const data = await authModuleService.validateCallback(
)
```
<Note>
Learn more about the parameters and return type of the `IAuthModuleService`'s `validateCallback` method in [this reference](/references/auth/validateCallback).
</Note>
If the authentication is successful, the auth providers `validateCallback` method returns the same data as the basic authentication:
If the authentication is successful, the `validateCallback` method returns the same data as the basic authentication:
```ts
data = {