docs: fixes following QA testing (#9690)

This commit is contained in:
Shahed Nasser
2024-10-22 18:20:21 +03:00
committed by GitHub
parent b2122c4073
commit 731309e87a
40 changed files with 70 additions and 66 deletions
@@ -147,7 +147,7 @@ import { Modules } from "@medusajs/framework/utils"
createProductsWorkflow.hooks.productsCreated(
async ({ products, additional_data }, { container }) => {
if (!additional_data.brand) {
if (!additional_data?.brand) {
return
}
@@ -204,4 +204,4 @@ createProductsWorkflow.hooks.productsCreated(
)
```
This updates the product to their original state before adding the brand to their `metadata` property.
This updates the products to their original state before adding the brand to their `metadata` property.
@@ -68,7 +68,7 @@ export default defineMiddlewares({
The `authenticate` middleware function accepts three parameters:
1. The type of user authenticating. Use `user` for authenticating admin users, and `customer` for authenticating customers. You can also pass `*` to allow all types of users.
2. An array of the types of authentication methods allowed. Both `user` and `customer` scopes support `session` and `bearer`. The `admin` scope also supports the `api-key` authentication method.
2. An array of types of authentication methods allowed. Both `user` and `customer` scopes support `session` and `bearer`. The `admin` scope also supports the `api-key` authentication method.
3. An optional object of configurations accepting the following property:
- `allowUnauthenticated`: (default: `false`) A boolean indicating whether authentication is required. For example, you may have an API route where you want to access the logged-in customer if available, but guest customers can still access it too.