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 * export const sdk = new Medusa({
14 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
15 * debug: import.meta.env.DEV,
16 * auth: {
17 * type: "session",
18 * },
19 * })
20 *
21 * await sdk.auth.logout()
22 *
23 * // user is now logged out
24 * // you can't send any requests that require authentication
25 * - lang: Shell
26 * label: cURL
27 * source: |-
28 * curl -X DELETE '{backend_url}/auth/session' \
29 * -H 'Cookie: connect.sid={sid}'
30 * tags:
31 * - Auth
32 * responses:
33 * "200":
34 * description: OK
35 * content:
36 * application/json:
37 * schema:
38 * type: object
39 * description: The deletion's details.
40 * required:
41 * - success
42 * properties:
43 * success:
44 * type: boolean
45 * title: success
46 * description: Whether the session was deleted successfully.
47 * "400":
48 * $ref: "#/components/responses/400_error"
49 * "401":
50 * $ref: "#/components/responses/unauthorized"
51 * "404":
52 * $ref: "#/components/responses/not_found_error"
53 * "409":
54 * $ref: "#/components/responses/invalid_state_error"
55 * "422":
56 * $ref: "#/components/responses/invalid_request_error"
57 * "500":
58 * $ref: "#/components/responses/500_error"
59 *
60 */
61