diff --git a/packages/generated/client-types/src/lib/models/AdminBearerAuthRes.ts b/packages/generated/client-types/src/lib/models/AdminBearerAuthRes.ts index 4536008501fa5..fa81e2c7baa6c 100644 --- a/packages/generated/client-types/src/lib/models/AdminBearerAuthRes.ts +++ b/packages/generated/client-types/src/lib/models/AdminBearerAuthRes.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface AdminBearerAuthRes { /** - * Access token for subsequent authorization. + * Access token that can be used to send authenticated requests. */ - accessToken?: string + access_token?: string } diff --git a/packages/generated/client-types/src/lib/models/StoreBearerAuthRes.ts b/packages/generated/client-types/src/lib/models/StoreBearerAuthRes.ts index 64364f6152bb8..e74a9e9f6b119 100644 --- a/packages/generated/client-types/src/lib/models/StoreBearerAuthRes.ts +++ b/packages/generated/client-types/src/lib/models/StoreBearerAuthRes.ts @@ -5,7 +5,7 @@ import { SetRelation, Merge } from "../core/ModelUtils" export interface StoreBearerAuthRes { /** - * Access token for subsequent authorization. + * Access token that can be used to send authenticated requests. */ - accessToken?: string + access_token?: string } diff --git a/packages/medusa/src/api/routes/admin/auth/get-token.ts b/packages/medusa/src/api/routes/admin/auth/get-token.ts index 0c99669ea348c..f53381a4d1b47 100644 --- a/packages/medusa/src/api/routes/admin/auth/get-token.ts +++ b/packages/medusa/src/api/routes/admin/auth/get-token.ts @@ -10,10 +10,7 @@ import { AdminPostAuthReq } from "./create-session" * operationId: "PostToken" * summary: "User Login (JWT)" * x-authenticated: false - * description: "After a successful login, a JWT token is returned for subsequent authorization." - * parameters: - * - (body) email=* {string} The User's email. - * - (body) password=* {string} The User's password. + * description: "After a successful login, a JWT token is returned, which can be used to send authenticated requests." * requestBody: * content: * application/json: @@ -31,14 +28,14 @@ import { AdminPostAuthReq } from "./create-session" * email: 'user@example.com', * password: 'supersecret' * }) - * .then(({ accessToken }) => { - * console.log(accessToekn); + * .then(({ access_token }) => { + * console.log(access_token); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/admin/auth/token' \ - * --header 'Content-Type: application/json' \ + * curl -X POST '{backend_url}/admin/auth/token' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "password": "supersecret" diff --git a/packages/medusa/src/api/routes/admin/auth/index.ts b/packages/medusa/src/api/routes/admin/auth/index.ts index 34ac7ac94ba7c..7aa5b49fa3dfd 100644 --- a/packages/medusa/src/api/routes/admin/auth/index.ts +++ b/packages/medusa/src/api/routes/admin/auth/index.ts @@ -44,8 +44,8 @@ export type AdminAuthRes = { * @schema AdminBearerAuthRes * type: object * properties: - * accessToken: - * description: Access token for subsequent authorization. + * access_token: + * description: Access token that can be used to send authenticated requests. * type: string */ export type AdminBearerAuthRes = { diff --git a/packages/medusa/src/api/routes/store/auth/delete-session.ts b/packages/medusa/src/api/routes/store/auth/delete-session.ts index 5d0ca546ed2c4..296ca5e03678b 100644 --- a/packages/medusa/src/api/routes/store/auth/delete-session.ts +++ b/packages/medusa/src/api/routes/store/auth/delete-session.ts @@ -11,7 +11,7 @@ * label: cURL * source: | * curl -X DELETE '{backend_url}/store/auth' \ - * -H 'Cookie: connect.sid={sid}' + * -H 'Authorization: Bearer {access_token}' * security: * - cookie_auth: [] * - jwt_token: [] diff --git a/packages/medusa/src/api/routes/store/auth/get-session.ts b/packages/medusa/src/api/routes/store/auth/get-session.ts index a809585b119f1..028e5b13e7562 100644 --- a/packages/medusa/src/api/routes/store/auth/get-session.ts +++ b/packages/medusa/src/api/routes/store/auth/get-session.ts @@ -24,7 +24,7 @@ import { defaultRelations } from "." * label: cURL * source: | * curl '{backend_url}/store/auth' \ - * -H 'Cookie: connect.sid={sid}' + * -H 'Authorization: Bearer {access_token}' * security: * - cookie_auth: [] * - jwt_token: [] diff --git a/packages/medusa/src/api/routes/store/auth/get-token.ts b/packages/medusa/src/api/routes/store/auth/get-token.ts index 77213545e40c2..7e0287ca119f1 100644 --- a/packages/medusa/src/api/routes/store/auth/get-token.ts +++ b/packages/medusa/src/api/routes/store/auth/get-token.ts @@ -6,14 +6,11 @@ import { validator } from "../../../../utils/validator" import { StorePostAuthReq } from "./create-session" /** - * @oas [post] /store/token + * @oas [post] /store/auth/token * operationId: "PostToken" * summary: "Customer Login (JWT)" * x-authenticated: false - * description: "After a successful login, a JWT token is returned for subsequent authorization." - * parameters: - * - (body) email=* {string} The User's email. - * - (body) password=* {string} The User's password. + * description: "After a successful login, a JWT token is returned, which can be used to send authenticated requests." * requestBody: * content: * application/json: @@ -27,18 +24,18 @@ import { StorePostAuthReq } from "./create-session" * source: | * 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); * }); * - lang: Shell * label: cURL * source: | - * curl --location --request POST 'https://medusa-url.com/store/auth/token' \ - * --header 'Content-Type: application/json' \ + * curl -X POST '{backend_url}/store/auth/token' \ + * -H 'Content-Type: application/json' \ * --data-raw '{ * "email": "user@example.com", * "password": "supersecret" diff --git a/packages/medusa/src/api/routes/store/auth/index.ts b/packages/medusa/src/api/routes/store/auth/index.ts index 2f1f701094322..de25b355c60e0 100644 --- a/packages/medusa/src/api/routes/store/auth/index.ts +++ b/packages/medusa/src/api/routes/store/auth/index.ts @@ -46,8 +46,8 @@ export type StoreAuthRes = { * @schema StoreBearerAuthRes * type: object * properties: - * accessToken: - * description: Access token for subsequent authorization. + * access_token: + * description: Access token that can be used to send authenticated requests. * type: string */ export type StoreBearerAuthRes = { diff --git a/packages/medusa/src/api/routes/store/customers/create-address.ts b/packages/medusa/src/api/routes/store/customers/create-address.ts index 8230d9ff9801a..876afcfe2056f 100644 --- a/packages/medusa/src/api/routes/store/customers/create-address.ts +++ b/packages/medusa/src/api/routes/store/customers/create-address.ts @@ -46,7 +46,7 @@ import { validator } from "../../../../utils/validator" * label: cURL * source: | * 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": { diff --git a/packages/medusa/src/api/routes/store/customers/delete-address.ts b/packages/medusa/src/api/routes/store/customers/delete-address.ts index d9b00e1d53101..a8e742344d46d 100644 --- a/packages/medusa/src/api/routes/store/customers/delete-address.ts +++ b/packages/medusa/src/api/routes/store/customers/delete-address.ts @@ -28,7 +28,7 @@ import CustomerService from "../../../../services/customer" * label: cURL * source: | * curl -X DELETE '{backend_url}/store/customers/me/addresses/{address_id}' \ - * -H 'Cookie: connect.sid={sid}' + * -H 'Authorization: Bearer {access_token}' * security: * - cookie_auth: [] * - jwt_token: [] diff --git a/packages/medusa/src/api/routes/store/customers/get-customer.ts b/packages/medusa/src/api/routes/store/customers/get-customer.ts index 394f35d18cda7..f10f6ca019df5 100644 --- a/packages/medusa/src/api/routes/store/customers/get-customer.ts +++ b/packages/medusa/src/api/routes/store/customers/get-customer.ts @@ -24,7 +24,7 @@ import CustomerService from "../../../../services/customer" * label: cURL * source: | * curl '{backend_url}/store/customers/me' \ - * -H 'Cookie: connect.sid={sid}' + * -H 'Authorization: Bearer {access_token}' * security: * - cookie_auth: [] * - jwt_token: [] diff --git a/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts b/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts index 89889dc7f146d..e05340ae583ff 100644 --- a/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts +++ b/packages/medusa/src/api/routes/store/customers/get-payment-methods.ts @@ -28,7 +28,7 @@ import { PaymentProvider } from "../../../../models" * label: cURL * source: | * curl '{backend_url}/store/customers/me/payment-methods' \ - * -H 'Cookie: connect.sid={sid}' + * -H 'Authorization: Bearer {access_token}' * security: * - cookie_auth: [] * - jwt_token: [] diff --git a/packages/medusa/src/api/routes/store/customers/list-orders.ts b/packages/medusa/src/api/routes/store/customers/list-orders.ts index 6653283f80820..597a26fc5af40 100644 --- a/packages/medusa/src/api/routes/store/customers/list-orders.ts +++ b/packages/medusa/src/api/routes/store/customers/list-orders.ts @@ -158,7 +158,7 @@ import { DateComparisonOperator } from "../../../../types/common" * label: cURL * source: | * curl '{backend_url}/store/customers/me/orders' \ - * -H 'Cookie: connect.sid={sid}' + * -H 'Authorization: Bearer {access_token}' * security: * - cookie_auth: [] * - jwt_token: [] diff --git a/packages/medusa/src/api/routes/store/customers/update-address.ts b/packages/medusa/src/api/routes/store/customers/update-address.ts index 2294615260b83..c0bdd033f6c27 100644 --- a/packages/medusa/src/api/routes/store/customers/update-address.ts +++ b/packages/medusa/src/api/routes/store/customers/update-address.ts @@ -37,7 +37,7 @@ import { validator } from "../../../../utils/validator" * label: cURL * source: | * 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" diff --git a/packages/medusa/src/api/routes/store/customers/update-customer.ts b/packages/medusa/src/api/routes/store/customers/update-customer.ts index 101ca9a02201f..fc9df54a11e8f 100644 --- a/packages/medusa/src/api/routes/store/customers/update-customer.ts +++ b/packages/medusa/src/api/routes/store/customers/update-customer.ts @@ -37,7 +37,7 @@ import { IsType } from "../../../../utils/validators/is-type" * label: cURL * source: | * 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" diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_auth_token/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_auth_token/post.js index b5d27480e8071..ac6963ea401d3 100644 --- a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_auth_token/post.js +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_auth_token/post.js @@ -4,6 +4,6 @@ medusa.admin.auth.getToken({ email: 'user@example.com', password: 'supersecret' }) -.then(({ accessToken }) => { - console.log(accessToekn); +.then(({ access_token }) => { + console.log(access_token); }); diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_auth_token/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_auth_token/post.sh index 7d77bd67cac45..9804a33d6867a 100644 --- a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_auth_token/post.sh +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_auth_token/post.sh @@ -1,5 +1,5 @@ -curl --location --request POST 'https://medusa-url.com/admin/auth/token' \ ---header 'Content-Type: application/json' \ +curl -X POST '{backend_url}/admin/auth/token' \ +-H 'Content-Type: application/json' \ --data-raw '{ "email": "user@example.com", "password": "supersecret" diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminBearerAuthRes.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminBearerAuthRes.yaml index 8a395a21c49ed..096d46cc6ba2a 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminBearerAuthRes.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminBearerAuthRes.yaml @@ -1,5 +1,5 @@ type: object properties: - accessToken: - description: Access token for subsequent authorization. + access_token: + description: Access token that can be used to send authenticated requests. type: string diff --git a/www/apps/api-reference/specs/admin/paths/admin_auth_token.yaml b/www/apps/api-reference/specs/admin/paths/admin_auth_token.yaml index a57825a82a28d..bf3d4df3b949d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_auth_token.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_auth_token.yaml @@ -3,24 +3,13 @@ post: summary: User Login (JWT) x-authenticated: false description: >- - After a successful login, a JWT token is returned for subsequent - authorization. - parameters: [] + After a successful login, a JWT token is returned, which can be used to send + authenticated requests. requestBody: content: application/json: schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The User's email. - password: - type: string - description: The User's password. + $ref: ../components/schemas/AdminPostAuthReq.yaml x-codegen: method: getToken x-codeSamples: diff --git a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_token/post.js b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_auth_token/post.js similarity index 67% rename from www/apps/api-reference/specs/store/code_samples/JavaScript/store_token/post.js rename to www/apps/api-reference/specs/store/code_samples/JavaScript/store_auth_token/post.js index ae9acfd56ddd9..67972b7404ea4 100644 --- a/www/apps/api-reference/specs/store/code_samples/JavaScript/store_token/post.js +++ b/www/apps/api-reference/specs/store/code_samples/JavaScript/store_auth_token/post.js @@ -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); }); diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/delete.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/delete.sh index f4103e42b3751..c1f3e1d616447 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/delete.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/delete.sh @@ -1,2 +1,2 @@ curl -X DELETE '{backend_url}/store/auth' \ --H 'Cookie: connect.sid={sid}' +-H 'Authorization: Bearer {access_token}' diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/get.sh index 7a16d003b9025..1130a2116afa4 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/get.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_auth/get.sh @@ -1,2 +1,2 @@ curl '{backend_url}/store/auth' \ --H 'Cookie: connect.sid={sid}' +-H 'Authorization: Bearer {access_token}' diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_auth_token/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_auth_token/post.sh new file mode 100644 index 0000000000000..c969e0fe3b5b7 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_auth_token/post.sh @@ -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" +}' diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/get.sh index 16c3a7002706f..beb12de62da7e 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/get.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/get.sh @@ -1,2 +1,2 @@ curl '{backend_url}/store/customers/me' \ --H 'Cookie: connect.sid={sid}' +-H 'Authorization: Bearer {access_token}' diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/post.sh index dde6f21346b3f..390872ff80f36 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/post.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me/post.sh @@ -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" diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses/post.sh index f5a7cd877b022..2565459f5a36d 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses/post.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses/post.sh @@ -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": { diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh index 78cd1fb7a96a9..609da1616a1a2 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/delete.sh @@ -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}' diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh index 3969bfbc6860d..402c7fe33597e 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_addresses_{address_id}/post.sh @@ -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" diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_orders/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_orders/get.sh index 1fed671da4e52..fb9434ba22234 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_orders/get.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_orders/get.sh @@ -1,2 +1,2 @@ curl '{backend_url}/store/customers/me/orders' \ --H 'Cookie: connect.sid={sid}' +-H 'Authorization: Bearer {access_token}' diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_payment-methods/get.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_payment-methods/get.sh index bd78c6e437878..209780f74d1ee 100644 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_payment-methods/get.sh +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_customers_me_payment-methods/get.sh @@ -1,2 +1,2 @@ curl '{backend_url}/store/customers/me/payment-methods' \ --H 'Cookie: connect.sid={sid}' +-H 'Authorization: Bearer {access_token}' diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_token/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_token/post.sh deleted file mode 100644 index 0ec13e1f2e72a..0000000000000 --- a/www/apps/api-reference/specs/store/code_samples/Shell/store_token/post.sh +++ /dev/null @@ -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" -}' diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreBearerAuthRes.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreBearerAuthRes.yaml index 8a395a21c49ed..096d46cc6ba2a 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreBearerAuthRes.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreBearerAuthRes.yaml @@ -1,5 +1,5 @@ type: object properties: - accessToken: - description: Access token for subsequent authorization. + access_token: + description: Access token that can be used to send authenticated requests. type: string diff --git a/www/apps/api-reference/specs/store/openapi.yaml b/www/apps/api-reference/specs/store/openapi.yaml index eb1e9df52f0ad..314d6b84c607d 100644 --- a/www/apps/api-reference/specs/store/openapi.yaml +++ b/www/apps/api-reference/specs/store/openapi.yaml @@ -154,6 +154,8 @@ servers: paths: /store/auth: $ref: paths/store_auth.yaml + /store/auth/token: + $ref: paths/store_auth_token.yaml /store/auth/{email}: $ref: paths/store_auth_{email}.yaml /store/carts: @@ -262,8 +264,6 @@ paths: $ref: paths/store_swaps.yaml /store/swaps/{cart_id}: $ref: paths/store_swaps_{cart_id}.yaml - /store/token: - $ref: paths/store_token.yaml /store/variants: $ref: paths/store_variants.yaml /store/variants/{id}: diff --git a/www/apps/api-reference/specs/store/paths/store_token.yaml b/www/apps/api-reference/specs/store/paths/store_auth_token.yaml similarity index 64% rename from www/apps/api-reference/specs/store/paths/store_token.yaml rename to www/apps/api-reference/specs/store/paths/store_auth_token.yaml index ec1e07783efe9..df6f066bb5e07 100644 --- a/www/apps/api-reference/specs/store/paths/store_token.yaml +++ b/www/apps/api-reference/specs/store/paths/store_auth_token.yaml @@ -3,35 +3,24 @@ post: summary: Customer Login (JWT) x-authenticated: false description: >- - After a successful login, a JWT token is returned for subsequent - authorization. - parameters: [] + After a successful login, a JWT token is returned, which can be used to send + authenticated requests. requestBody: content: application/json: schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The User's email. - password: - type: string - description: The User's password. + $ref: ../components/schemas/StorePostAuthReq.yaml x-codegen: method: getToken x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store_token/post.js + $ref: ../code_samples/JavaScript/store_auth_token/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_token/post.sh + $ref: ../code_samples/Shell/store_auth_token/post.sh tags: - Auth responses: