-
Notifications
You must be signed in to change notification settings - Fork 2
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/keep browser open #21
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe update enhances the React Native SDK for Kinde, focusing on authentication improvements, token management, and user interface options. It introduces merging additional parameters in the authentication process, a method for forced token refresh, and updates the SDK version. Additionally, it adds options for web browser behavior in the SDK Utils module and revises testing strategies by removing outdated dependencies and incorporating new functionality tests. 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
bin/configs/kinde-react-native.yaml
is excluded by:!**/*.yaml
kinde-mgmt-api-specs.yaml
is excluded by:!**/*.yaml
Files selected for processing (4)
- generators/react-native/src/main/java/com/kinde/codegen/KindeReactNativeGenerator.java (1 hunks)
- generators/react-native/src/main/resources/react-native/SDK/KindeSDK.mustache (3 hunks)
- generators/react-native/src/main/resources/react-native/SDK/Utils.mustache (1 hunks)
- generators/react-native/src/main/resources/react-native/index.spec.mustache (5 hunks)
Additional comments: 8
generators/react-native/src/main/resources/react-native/SDK/Utils.mustache (1)
- 194-195: The addition of
forceCloseOnRedirection
andshowInRecents
options to theopenWebBrowser
function enhances the control developers have over the browser's behavior. However, it's crucial to ensure that these options are documented clearly, including their default values and impact on the browser's behavior. This will help developers understand how to use these options effectively.Consider adding detailed documentation for these new options in the SDK's official documentation or inline comments.
generators/react-native/src/main/resources/react-native/SDK/KindeSDK.mustache (3)
- 136-139: The implementation of
additionalParametersMerged
in theregister
method correctly merges existing and new additional parameters. This approach ensures that any custom parameters provided during registration are combined with the default parameters set during the SDK initialization. This is a good practice as it allows for flexibility and customization in the authentication process.- 267-291: The
forceTokenRefresh
method is a valuable addition for managing token lifecycle. However, it's important to handle the case where the token refresh fails more gracefully. Currently, if the refresh fails,null
is returned, which might not be informative enough for the developer to understand the cause of the failure.Consider throwing a custom exception or returning a more descriptive error object in case of token refresh failure. This would help developers implement more robust error handling in their applications.
- 306-306: Updating the
Kinde-SDK
version in thefetchToken
method's headers toReactNative/1.2.3
is a good practice as it helps with tracking the SDK version used in API requests. This can be beneficial for debugging and analytics purposes.generators/react-native/src/main/resources/react-native/index.spec.mustache (3)
- 23-26: The introduction of a symbol for state in
FormDataMock
is a good practice for encapsulating the internal state and preventing accidental access or modification from outside the class. This change enhances the maintainability and security of the mock implementation.- 29-31: Adding an
append
method toFormDataMock
is a necessary enhancement for mimicking the behavior of the FormData API, allowing for a more accurate simulation of form data manipulation in tests. This addition improves the testability of components that interact with FormData.- 871-1177: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [758-1161]
The added tests cover a wide range of functionalities, including claims, permissions, organizations, user details, flags, and token refresh mechanisms. It's commendable that the tests are thorough and seem to cover both positive and negative scenarios. However, ensure that edge cases and error handling paths are also adequately tested to improve the robustness of the SDK.
generators/react-native/src/main/java/com/kinde/codegen/KindeReactNativeGenerator.java (1)
- 47-47: The update of the
projectName
variable to"@kinde-oss/react-native-sdk-0-7x"
correctly reflects the intended minor version or variant change in the SDK. This change is clear and aligns with the PR objectives.
Explain your changes
Suppose there is a related issue with enough detail for a reviewer to understand your changes fully. In that case, you can omit an explanation and instead include either “Fixes #XX” or “Updates #XX” where “XX” is the issue number.
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.
Summary by CodeRabbit
forceTokenRefresh
option for refreshing access tokens.forceCloseOnRedirection
andshowInRecents
options in the SDK Utils module for enhanced web browser control.authenticate
method for improved flexibility.ReactNative/1.2.3
.projectName
variable for consistency.ApiClient
import and usage in tests.FormDataMock
for better test reliability.