1 /**
2 * @oas [delete] /auth/session
3 * operationId: DeleteSession
4 * summary: Delete Authentication Session
5 * description: Deletes the cookie session ID previously set for authentication.
6 * x-authenticated: true
7 * x-codeSamples:
8 * - lang: JavaScript
9 * label: JS SDK
10 * source: |-
11 * import Medusa from "@medusajs/js-sdk"
12 *
13 * let MEDUSA_BACKEND_URL = "http://localhost:9000"
14 *
15 * if (process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL) {
16 * MEDUSA_BACKEND_URL = process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL
17 * }
18 *
19 * export const sdk = new Medusa({
20 * baseUrl: MEDUSA_BACKEND_URL,
21 * debug: process.env.NODE_ENV === "development",
22 * publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY,
23 * })
24 *
25 * await sdk.auth.logout()
26 *
27 * // customer is now logged out
28 * // you can't send any requests that require authentication
29 * - lang: Shell
30 * label: cURL
31 * source: |-
32 * curl -X DELETE '{backend_url}/auth/session' \
33 * -H 'Cookie: connect.sid={sid}'
34 * tags:
35 * - Auth
36 * responses:
37 * "200":
38 * description: OK
39 * content:
40 * application/json:
41 * schema:
42 * type: object
43 * description: The deletion's details.
44 * required:
45 * - success
46 * properties:
47 * success:
48 * type: boolean
49 * title: success
50 * description: Whether the session was deleted successfully.
51 * "400":
52 * $ref: "#/components/responses/400_error"
53 * "401":
54 * $ref: "#/components/responses/unauthorized"
55 * "404":
56 * $ref: "#/components/responses/not_found_error"
57 * "409":
58 * $ref: "#/components/responses/invalid_state_error"
59 * "422":
60 * $ref: "#/components/responses/invalid_request_error"
61 * "500":
62 * $ref: "#/components/responses/500_error"
63 *
64 */
65