-
-
Notifications
You must be signed in to change notification settings - Fork 192
Optional Login from browser support #2368
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3f491d4
chore: login working in the browser
abose 86373a6
chore: login workflow messaging and dialogs
abose 3ab3b7c
chore: desktop take to accounts page when signout fails
abose 2bf0917
chore: switchable account between local and account.phcode.dev
abose 342e9ec
fix: localhost:8000/src should work without trailing /
abose 40f1ea6
chore: signout from browser app working, tested in localhost
abose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <div class="browser-login-waiting-dialog modal"> | ||
| <div class="modal-header"> | ||
| <h1 class="dialog-title">{{Strings.SIGN_IN_WAITING_TITLE}}</h1> | ||
| </div> | ||
| <div class="modal-body"> | ||
| <div class="waiting-content-container"> | ||
| <p>{{Strings.SIGN_IN_WAITING_MESSAGE}}</p> | ||
| <div class="login-status-container" style="margin: 20px 0; text-align: center;"> | ||
| <div id="login-status" style="color: #666; font-style: italic; font-size: 14px;"> | ||
| {{Strings.WAITING_FOR_LOGIN}} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="modal-footer"> | ||
| <button class="btn" data-button-id="cancel">{{Strings.CANCEL}}</button> | ||
| <button class="btn primary" data-button-id="check">{{Strings.CHECK_NOW}}</button> | ||
| </div> | ||
| </div> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Server-side URL redirect Medium
Copilot Autofix
AI 6 months ago
The best way to fix this problem is to avoid using the raw
req.urlin the redirect and instead construct a canonical, relative URL path based solely on validated input. Specifically, when redirecting a user to the trailing slash version of a directory, parse and reconstruct the pathname—without including any potentially harmful user-supplied query strings or full URLs. The correct approach is to use the parsed pathname (fromurl.parse(req.url, true)) and ensure the result is a relative path (not an absolute URL). Additionally, you may want to re-attach the original query parameters (if any), to preserve search parameters when redirecting, but do so via encoding.In practical terms, replace
res.writeHead(301, { 'Location': req.url + '/' });with a construct that starts with the URL-parsed pathname, appends the trailing slash, and (optionally) preserves the query string, ensuring the entire result is a relative path. All code changes can be made directly in serve-proxy.js at line 302, using standard Node.js modules you are already importing.