-
Notifications
You must be signed in to change notification settings - Fork 751
fix(sso): login with custom startUrl not allowed #6368
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "type": "Bug Fix", | ||
| "description": "Auth: Valid StartURL not accepted at login" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,3 +58,15 @@ export function toUri(path: string | vscode.Uri): vscode.Uri { | |
| } | ||
| return vscode.Uri.file(path) | ||
| } | ||
|
|
||
| export function isValidUrl(string: string): boolean { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would add additional LOC since we'd have to check every part manually. Also there may be nuances with a valid URL that we could miss |
||
| try { | ||
| const url = new URL(string) | ||
| // handle case where, eg: 'https://test', would be considered valid. At a minimum | ||
| // we'll require a top-level domain, eg: 'https://test.com'. | ||
| const hostParts = url.hostname.split('.').filter((part) => !!part) | ||
| return hostParts.length > 1 | ||
| } catch (err) { | ||
| return false | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "type": "Bug Fix", | ||
| "description": "Auth: Valid StartURL not accepted at login" | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.