Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Validate jwt string allowing alphanumeric, underscore, hyphen and checking for min 32 characters

Terry Sutton485177039fb6
diff --git a/studio/pages/project/[ref]/settings/api.tsx b/studio/pages/project/[ref]/settings/api.tsx
index 7232d745585..1f812ac43ce 100644
--- a/studio/pages/project/[ref]/settings/api.tsx
+++ b/studio/pages/project/[ref]/settings/api.tsx
@@ -389,7 +389,7 @@ const ServiceList: FC<any> = ({ projectRef }) => {
</Button>
<Button
type="primary"
- disabled={customToken.length < 32}
+ disabled={!customToken.match(/^[a-zA-Z0-9-_]{32,}$/)}
loading={isSubmittingJwtSecretUpdateRequest}
onClick={() => handleJwtSecretUpdate(customToken, setIsCreatingKey)}
>