-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Peter/fix/istokenvalid check audience #189
Conversation
WalkthroughThe recent changes include adjustments to the import statements, string formatting, and property assignments in various files. The Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
src/utils/pageRouter/isTokenValid.js (1)
14-14
: LGTM! But consider using optional chaining for safety.The change correctly uses the spread operator to handle audience checks when
config.audience
is an array. However, using optional chaining can make the code more robust.- accessTokenPayload.aud.includes(...config.audience); + accessTokenPayload.aud?.includes(...config.audience);Tools
Biome
[error] 13-14: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- playground/src/middleware.ts (1 hunks)
- src/config/index.js (1 hunks)
- src/utils/pageRouter/isTokenValid.js (1 hunks)
- types.d.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- playground/src/middleware.ts
Additional context used
Biome
src/utils/pageRouter/isTokenValid.js
[error] 13-14: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
Additional comments not posted (2)
src/config/index.js (1)
72-72
: LGTM!The change ensures that the
audience
property is correctly set as an array of strings whenKINDE_AUDIENCE
is a space-separated string. This improves the flexibility and robustness of the configuration.types.d.ts (1)
15-15
: LGTM!The addition of the
exp
property to theKindeAccessToken
type is appropriate and ensures that the type accurately reflects the structure of the access token.
…udience Peter/fix/istokenvalid check audience
Explain your changes
isTokenValid
audience check which was breaking when audience was an array and middleware was being usedKindeAccessToken
to includeexp
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.