Skip to content

Commit 2456e19

Browse files
authored
Use encodeURIComponent instead of encodeURI to support returnURLs with more than one query (#20874)
When return URLs query parameters such as
1 parent 0ee1420 commit 2456e19

File tree

1 file changed

+1
-1
lines changed
  • src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/api-authorization

1 file changed

+1
-1
lines changed

src/ProjectTemplates/Web.Spa.ProjectTemplates/content/React-CSharp/ClientApp/src/components/api-authorization/AuthorizeRoute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class AuthorizeRoute extends Component {
2828
var link = document.createElement("a");
2929
link.href = this.props.path;
3030
const returnUrl = `${link.protocol}//${link.host}${link.pathname}${link.search}${link.hash}`;
31-
const redirectUrl = `${ApplicationPaths.Login}?${QueryParameterNames.ReturnUrl}=${encodeURI(returnUrl)}`
31+
const redirectUrl = `${ApplicationPaths.Login}?${QueryParameterNames.ReturnUrl}=${encodeURIComponent(returnUrl)}`
3232
if (!ready) {
3333
return <div></div>;
3434
} else {

0 commit comments

Comments
 (0)