From 867a9c14fa28e6cb091d736427fc7cbf434a0441 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Thu, 19 Dec 2024 18:01:42 -0500 Subject: [PATCH] format --- docs/testing/overview.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/testing/overview.mdx b/docs/testing/overview.mdx index 24c547a969..2aad464887 100644 --- a/docs/testing/overview.mdx +++ b/docs/testing/overview.mdx @@ -29,9 +29,9 @@ POST https://happy-hippo-1.clerk.accounts.dev/v1/client/sign_ups?__clerk_testing When writing tests using Clerk, if you need to get a valid session token, you can use the following flow: 1. If you have not already, [create a new user](https://clerk.com/docs/reference/backend-api/tag/Users#operation/CreateUser). -2. [Create a new session](https://clerk.com/docs/reference/backend-api/tag/Sessions#operation/createSession) for the user. -3. [Create a session token](https://clerk.com/docs/reference/backend-api/tag/Sessions#operation/CreateSessionToken) using the session ID returned in the previous step. -4. Pass the returned session token as the value of an Authorization header to any other requests you're making, as such: `Authorization: Bearer `. +1. [Create a new session](https://clerk.com/docs/reference/backend-api/tag/Sessions#operation/createSession) for the user. +1. [Create a session token](https://clerk.com/docs/reference/backend-api/tag/Sessions#operation/CreateSessionToken) using the session ID returned in the previous step. +1. Pass the returned session token as the value of an Authorization header to any other requests you're making, as such: `Authorization: Bearer `. Note that Clerk's session tokens are short-lived and are valid only for 60 seconds (learn more about why this is the case in [our "how clerk works" guide](/docs/how-clerk-works-overview)), if the session token expires, you will need to refresh it with the same [create session token endpoint](https://clerk.com/docs/reference/backend-api/tag/Sessions#operation/CreateSessionToken). The most common ways to do this are to either hit this endpoint before every test to ensure you have a valid session token, or to run an interval timer that refreshes the token before it expires.