Currently following this guide
https://docs.medusajs.com/v2/resources/commerce-modules/auth/create-actor-type
When I'm trying to curl some endpoint specially on
curl -X POST 'http://localhost:9000/auth/manager/emailpass' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "supersecret"
}'
Which returns a token and create a row on auth_identity table which has a null value on app_metadata
And when I'm try to create a manager with the token with
curl -X POST 'http://localhost:9000/manager' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]"
}'
Keeps returning an error due to req.auth_context is undefined which I can't pass the auth_indentity_id. But when I'm trying to check the token on JWT.io website to verify the payload and I can confirm that token has payload. sample below.
{
"actor_id": "",
"actor_type": "manager",
"auth_identity_id": "authid_01J48BCRJV3S8BEC7CPY7GN04T",
"app_metadata": {},
"iat": 1722562273,
"exp": 1722648673
}