1 post:
2 operationId: PostSession
3 summary: Set Authentication Session
4 description: >-
5 Set the cookie session ID of a customer. The customer must be previously
6 authenticated with the `/auth/customer/{provider}` API route first, as the
7 JWT token is required in the header of the request.
8 externalDocs:
9 url: >-
10 https://docs.medusajs.com/resources/storefront-development/customers/login#2-using-a-cookie-session
11 description: 'Storefront development: How to login as a customer'
12 x-authenticated: true
13 x-codeSamples:
14 - lang: Shell
15 label: cURL
16 source:
17 $ref: ../code_samples/Shell/auth_session/post.sh
18 tags:
19 - Auth
20 responses:
21 '200':
22 description: OK
23 content:
24 application/json:
25 schema:
26 $ref: ../components/schemas/AuthStoreSessionResponse.yaml
27 '400':
28 $ref: ../components/responses/400_error.yaml
29 '401':
30 $ref: ../components/responses/unauthorized.yaml
31 '404':
32 $ref: ../components/responses/not_found_error.yaml
33 '409':
34 $ref: ../components/responses/invalid_state_error.yaml
35 '422':
36 $ref: ../components/responses/invalid_request_error.yaml
37 '500':
38 $ref: ../components/responses/500_error.yaml
39 delete:
40 operationId: DeleteSession
41 summary: Delete Authentication Session
42 description: Deletes the cookie session ID previously set for authentication.
43 x-authenticated: true
44 x-codeSamples:
45 - lang: JavaScript
46 label: JS SDK
47 source:
48 $ref: ../code_samples/JavaScript/auth_session/delete.js
49 - lang: Shell
50 label: cURL
51 source:
52 $ref: ../code_samples/Shell/auth_session/delete.sh
53 tags:
54 - Auth
55 responses:
56 '200':
57 description: OK
58 content:
59 application/json:
60 schema:
61 type: object
62 description: The deletion's details.
63 required:
64 - success
65 properties:
66 success:
67 type: boolean
68 title: success
69 description: Whether the session was deleted successfully.
70 '400':
71 $ref: ../components/responses/400_error.yaml
72 '401':
73 $ref: ../components/responses/unauthorized.yaml
74 '404':
75 $ref: ../components/responses/not_found_error.yaml
76 '409':
77 $ref: ../components/responses/invalid_state_error.yaml
78 '422':
79 $ref: ../components/responses/invalid_request_error.yaml
80 '500':
81 $ref: ../components/responses/500_error.yaml