From 0fa00718c32b7fb10cb8c0762fda89d73fac4f4b Mon Sep 17 00:00:00 2001 From: Madison Date: Fri, 5 Sep 2025 02:23:17 -0500 Subject: [PATCH] Updates again --- docs/templates-python/concepts/backend-integration.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/templates-python/concepts/backend-integration.mdx b/docs/templates-python/concepts/backend-integration.mdx index ceab99d55..eaf7c9eb0 100644 --- a/docs/templates-python/concepts/backend-integration.mdx +++ b/docs/templates-python/concepts/backend-integration.mdx @@ -300,6 +300,9 @@ stack_project_id = os.getenv("STACK_PROJECT_ID") stack_publishable_client_key = os.getenv("STACK_PUBLISHABLE_CLIENT_KEY") stack_secret_server_key = os.getenv("STACK_SECRET_SERVER_KEY") +if not stack_project_id: + raise RuntimeError("STACK_PROJECT_ID is not set") + def stack_auth_request(method, endpoint, **kwargs): res = requests.request( method, @@ -318,9 +321,6 @@ def stack_auth_request(method, endpoint, **kwargs): raise Exception(f"Stack Auth API request failed with {res.status_code}: {res.text}") return res.json() - if not stack_project_id: - raise RuntimeError("STACK_PROJECT_ID is not set") - # JWT verification setup jwks_client = PyJWKClient(f"https://api.stack-auth.com/api/v1/projects/{stack_project_id}/.well-known/jwks.json")