docs: add note about authentication opt out (#9298)

Closes #9268
This commit is contained in:
Shahed Nasser
2024-09-26 16:04:27 +03:00
committed by GitHub
parent 97b72f4662
commit 39a6780815

View File

@@ -108,6 +108,12 @@ To access the authentication details in an API route, such as the logged-in user
The `auth_context.actor_id` property of `AuthenticatedMedusaRequest` holds the ID of the authenticated user or customer. If there isn't any authenticated user or customer, `auth_context` is `undefined`.
<Note>
If you opt-out of authentication in a route as mentioned in the [previous section](#authentication-opt-out), you can't access the authenticated user or customer anymore. Use the [authenticate middleware](#protect-custom-api-routes) instead.
</Note>
### Retrieve Logged-In Customer's Details
You can access the logged-in customers ID in all API routes starting with `/store` using the `auth_context.actor_id` property of the `AuthenticatedMedusaRequest` object.