Skip to content

Fix/clerk frontend version pins#28

Closed
uzair-snap wants to merge 27 commits into
TimChild:mainfrom
snap-analytics:fix/clerk-frontend-version-pins
Closed

Fix/clerk frontend version pins#28
uzair-snap wants to merge 27 commits into
TimChild:mainfrom
snap-analytics:fix/clerk-frontend-version-pins

Conversation

@uzair-snap
Copy link
Copy Markdown

No description provided.

PJ-Snap and others added 27 commits October 8, 2025 12:32
Update import paths in ClerkSessionSynchronizer to use relative paths…
Refactor event handling in ClerkSessionSynchronizer to use ReflexEven…
…ionProfile, OrganizationSwitcher, and OrganizationList

This commit introduces four new components for managing organizations within the Clerk API. Each component includes customizable props for appearance, routing, and navigation after specific actions. The components are designed to enhance user interaction with organization creation, profile management, and switching between organizations.
…te prop names for clarity

This commit renames the 'hide_personal_account' prop to 'hide_personal' for consistency and adds 'hide_slug' and 'organization_profile_props' to both components, enhancing their configurability for organization management.
…l options

This commit refines the CreateOrganization, OrganizationProfile, OrganizationSwitcher, and OrganizationList components by updating prop types to use more specific types, including the addition of 'skip_invitation_screen' and 'hide_slug' options. These changes improve clarity and configurability for organization management within the Clerk API.
…onments

Frontend (ClerkSessionSynchronizer):
- Fix useEffect deps: [isSignedIn] -> [isLoaded, isSignedIn, addEvents, getToken]
- Add reconnect-safe resend via dedupe guard keyed on (stateKey, addEvents identity)
- Request fresh token with skipCache:true to avoid near-expiry tokens
- Clear session on token fetch failure to prevent stuck auth_checked=false

Backend (ClerkState.set_clerk_session):
- Add 60s leeway to JWT validation for clock skew tolerance
- Catch ExpiredTokenError (in addition to existing InvalidClaimError/MissingClaimError)
- Return clear_clerk_session on validation failure instead of raising
- Add set_jwt_validate_leeway_seconds() for downstream configuration

Tests:
- Add unit test for ExpiredTokenError -> clear session path
- Add JS string assertion for correct deps array and skipCache

Fixes: Authentication timeout after max attempts, auth not ready after timeout,
ExpiredTokenError crashes in set_clerk_session
Backend (ClerkState):
- Add validation for jwt_validate_leeway_seconds to ensure it is a non-negative integer and does not exceed 3600 seconds.

Frontend (ClerkSessionSynchronizer):
- Update function syntax to use double curly braces for JSX expressions.
- Refactor event handling to ensure proper session clearing on token retrieval failures.

Tests:
- Adjust imports for better module accessibility in tests.

These changes improve error handling and maintainability in the authentication process.
- Added 'pythonpath' to pytest configuration in pyproject.toml to include custom components.
- Improved validation in ClerkState to ensure 'jwt_validate_leeway_seconds' is a non-negative integer and not a boolean.
- Cleaned up test imports by removing unnecessary path adjustments for better module accessibility.

These changes streamline testing and enhance error handling in JWT validation.
…bility

fix: resolve auth timeout and ExpiredTokenError in multi-worker envir…
# Conflicts:
#	custom_components/reflex_clerk_api/clerk_provider.py
#	custom_components/reflex_clerk_api/organization_components.py
#	pyproject.toml
- wait_for_auth_check: snapshot auth_checked inside async with self; sleep
  outside lock; use monotonic deadline
- ClerkUser.load_user: background read/write phases; Clerk API I/O outside locks;
  add ClerkState.get_clerk_client() for shared client without holding clerk_state
@uzair-snap uzair-snap closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants