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:
@@ -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);
|
||||
});
|
||||
@@ -1,2 +1,2 @@
|
||||
curl -X DELETE '{backend_url}/store/auth' \
|
||||
-H 'Cookie: connect.sid={sid}'
|
||||
-H 'Authorization: Bearer {access_token}'
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl '{backend_url}/store/auth' \
|
||||
-H 'Cookie: connect.sid={sid}'
|
||||
-H 'Authorization: Bearer {access_token}'
|
||||
|
||||
@@ -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"
|
||||
}'
|
||||
@@ -1,2 +1,2 @@
|
||||
curl '{backend_url}/store/customers/me' \
|
||||
-H 'Cookie: connect.sid={sid}'
|
||||
-H 'Authorization: Bearer {access_token}'
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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}'
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl '{backend_url}/store/customers/me/orders' \
|
||||
-H 'Cookie: connect.sid={sid}'
|
||||
-H 'Authorization: Bearer {access_token}'
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl '{backend_url}/store/customers/me/payment-methods' \
|
||||
-H 'Cookie: connect.sid={sid}'
|
||||
-H 'Authorization: Bearer {access_token}'
|
||||
|
||||
@@ -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"
|
||||
}'
|
||||
Reference in New Issue
Block a user