Skip to content

Conversation

@kkajla12
Copy link
Contributor

@kkajla12 kkajla12 commented Jun 18, 2025

Add support for the feature_flags claim. This claim will be exposed on the session as featureFlags and will contain a list of the string slugs for feature flags that are enabled for the current user session based on organization membership.

const { featureFlags } = newSession;
if (featureFlags.includes('my_flag')) {
   // ...
}

@kkajla12 kkajla12 requested a review from nicknisi June 18, 2025 19:32
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Implements support for feature_flags claim across the AuthKit React Router library, exposing it as featureFlags in the session object for feature flag management based on organization membership.

  • ⚠️ Bug: Example code in README and PR description uses incorrect syntax includes['my_flag'] instead of includes('my_flag') for array method
  • Added feature_flags to AccessToken interface and featureFlags to session-related interfaces in src/interfaces.ts
  • Extended test coverage in src/auth.spec.ts and src/session.spec.ts to verify feature flag handling across authentication scenarios
  • Updated session management in src/session.ts to handle feature flags during authentication and refresh flows

5 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

@kkajla12 kkajla12 merged commit 441b28c into main Jun 20, 2025
6 checks passed
@kkajla12 kkajla12 deleted the feat/addFlagsSupport branch June 20, 2025 17:35
@kkajla12 kkajla12 mentioned this pull request Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants