chore(oas): Fix OAS related to JWT authentication (#5448)

* chore(oas): Fix OAS related to JWT authentication

* generate openapi spec files

* remove L option in curl examples
This commit is contained in:
Shahed Nasser
2023-10-23 11:48:02 +03:00
committed by GitHub
parent 1a10822cae
commit c67d490db3
34 changed files with 65 additions and 93 deletions

View File

@@ -1,9 +1,9 @@
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.store.auth.getToken({
medusa.auth.getToken({
email: 'user@example.com',
password: 'supersecret'
})
.then(({ accessToken }) => {
console.log(accessToken);
.then(({ access_token }) => {
console.log(access_token);
});

View File

@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/store/auth' \
-H 'Cookie: connect.sid={sid}'
-H 'Authorization: Bearer {access_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/store/auth' \
-H 'Cookie: connect.sid={sid}'
-H 'Authorization: Bearer {access_token}'

View File

@@ -0,0 +1,6 @@
curl -X POST '{backend_url}/store/auth/token' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com",
"password": "supersecret"
}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/store/customers/me' \
-H 'Cookie: connect.sid={sid}'
-H 'Authorization: Bearer {access_token}'

View File

@@ -1,5 +1,5 @@
curl -X POST '{backend_url}/store/customers/me' \
-H 'Cookie: connect.sid={sid}' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"first_name": "Laury"

View File

@@ -1,5 +1,5 @@
curl -X POST '{backend_url}/store/customers/me/addresses' \
-H 'Cookie: connect.sid={sid}' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"address": {

View File

@@ -1,2 +1,2 @@
curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Cookie: connect.sid={sid}'
-H 'Authorization: Bearer {access_token}'

View File

@@ -1,5 +1,5 @@
curl -X POST '{backend_url}/store/customers/me/addresses/{address_id}' \
-H 'Cookie: connect.sid={sid}' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"first_name": "Gina"

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/store/customers/me/orders' \
-H 'Cookie: connect.sid={sid}'
-H 'Authorization: Bearer {access_token}'

View File

@@ -1,2 +1,2 @@
curl '{backend_url}/store/customers/me/payment-methods' \
-H 'Cookie: connect.sid={sid}'
-H 'Authorization: Bearer {access_token}'

View File

@@ -1,6 +0,0 @@
curl --location --request POST 'https://medusa-url.com/store/auth/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com",
"password": "supersecret"
}'