-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(auth): Allow Web Urls on signInWithRedirect in Mobile Apps #12969
base: main
Are you sure you want to change the base?
Changes from all commits
b5c1540
11d9a3b
38e8850
5dba39a
484f316
528a984
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 |
---|---|---|
|
@@ -10,7 +10,12 @@ export function getRedirectUrl(redirects: string[]): string { | |
!redirect.startsWith('http://') && !redirect.startsWith('https://') | ||
); | ||
if (!redirect) { | ||
throw invalidRedirectException; | ||
} | ||
if (redirects.length === 0) { | ||
throw invalidRedirectException; | ||
} else { | ||
// fallsback to available redirect URL. Addresses: https://github.com/aws-amplify/amplify-js/issues/12890 | ||
return redirects[0]; | ||
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. Always return the first url? What if they want to call a particular url instead? 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. how a customer would select that? 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. +2 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. By re-directing to the right url is understanding please correct me |
||
} | ||
} | ||
return redirect; | ||
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. These changes will still return the 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. Good call, the issue is how a customer would choose which url to choose? 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. This will still choose first 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. Correct, with the current API there's no way to actively select which URL gets used. We (along with other platforms) use a heuristic to determine which URL to use. |
||
} |
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.
Nit: Looks like a tabbing error with this block