-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(native-app): Add optional scopes #14863
Conversation
WalkthroughThe changes in 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 (
|
Datadog ReportAll test runs ✅ 8 Total Test Services: 0 Failed, 8 Passed Test Services
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14863 +/- ##
==========================================
- Coverage 37.04% 36.98% -0.07%
==========================================
Files 6331 6327 -4
Lines 129120 129006 -114
Branches 36852 36817 -35
==========================================
- Hits 47835 47707 -128
- Misses 81285 81299 +14
Flags with carried forward coverage won't be shown. Click here to find out more. see 29 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/native/app/src/stores/auth-store.ts (2 hunks)
Additional Context Used
Path-based Instructions (1)
apps/native/app/src/stores/auth-store.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (2)
apps/native/app/src/stores/auth-store.ts (2)
22-23
: IntroduceOPTIONAL_SCOPES
to manage scopes that do not require a forced logout.This change aligns with the PR's objective to handle optional scopes effectively, ensuring that users are not logged out unnecessarily when such scopes are missing in the auth token.
205-208
: Ensure that the authentication check filters out optional scopes correctly.The modification to filter out
OPTIONAL_SCOPES
before checking the presence of required scopes is a robust solution to the problem of handling optional scopes. This change should prevent unnecessary logouts when a scope like@island.is/licenses:barcode
is not present, which is crucial for maintaining a smooth user experience.
* chore: add optional scopes to app * fix: update comment --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
What
Allow some scopes of the app to be optional.
Why
If we add a scope and the auth token does not have that scope we force a logout of the app. When dealing with some scopes like for example the barcode scope that is only used for a functionality that is hidden behind a feature flag we don't want to force logout for everyone.
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes