-
-
Notifications
You must be signed in to change notification settings - Fork 254
Fix race condition in popup based social sign-in (#10941) #10942
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
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe logic for determining the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SignInPanel
participant Urls
User->>SignInPanel: Initiates sign-in
SignInPanel->>SignInPanel: Check ReturnUrlQueryString
alt ReturnUrlQueryString is not null
SignInPanel->>User: Use ReturnUrlQueryString
else ReturnUrlQueryString is null
SignInPanel->>Urls: Use HomePage URL
SignInPanel->>User: Use HomePage as ReturnUrl
end
Assessment against linked issues
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Pull Request Overview
This PR ensures that when no return-url query parameter is provided, the sign-in panel falls back directly to the home page instead of the current relative path.
- Removed the
NavigationManager.GetRelativePath()fallback from theReturnUrlproperty. - Now defaults to
Urls.HomePagewhenReturnUrlQueryStringis null.
Comments suppressed due to low confidence (2)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs:21
- Consider adding unit tests to cover the ReturnUrl property, verifying both the case when ReturnUrlQueryString is provided and when it is null to ensure the fallback to HomePage works as intended.
private string ReturnUrl => ReturnUrlQueryString ?? Urls.HomePage;
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs:21
- [nitpick] Add a summary comment on the ReturnUrl property explaining that it falls back to the home page when no return-url query string is present.
private string ReturnUrl => ReturnUrlQueryString ?? Urls.HomePage;
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
🧹 Nitpick comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs (1)
186-186: Remove redundant null check.Since
ReturnUrlnow always returns a non-null value (eitherReturnUrlQueryStringorUrls.HomePage), the null coalescing operator is redundant.Apply this diff to simplify the navigation call:
-NavigationManager.NavigateTo(ReturnUrl ?? Urls.HomePage, replace: true); +NavigationManager.NavigateTo(ReturnUrl, replace: true);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting
📒 Files selected for processing (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build and test
🔇 Additional comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Identity/SignIn/SignInPanel.razor.cs (1)
21-21: LGTM! Simplified ReturnUrl logic resolves the issue.This change effectively fixes the sign-in page issue by removing the problematic fallback to
NavigationManager.GetRelativePath()and directly defaulting toUrls.HomePagewhen no return URL is provided. The simplified implementation is more predictable and should resolve the reported issue.
closes #10941
Summary by CodeRabbit