Skip to content

Commit 572872d

Browse files
authored
Merge pull request #1595 from topcoder-platform/pm-217
PM-217: poor validation cross site scripting
2 parents c4abefe + 9db44be commit 572872d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/routes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class Routes extends React.Component {
9494
getFreshToken().then((token) => {
9595
this.props.saveToken(token)
9696
}).catch((error) => {
97-
console.error(error)
98-
const redirectBackToUrl = window.location.origin + this.props.location.pathname
99-
window.location = ACCOUNTS_APP_LOGIN_URL + '?retUrl=' + redirectBackToUrl
97+
console.error(error.message)
98+
const redirectBackToUrl = encodeURIComponent(window.location.origin + this.props.location.pathname)
99+
window.location = `${ACCOUNTS_APP_LOGIN_URL}?retUrl=${redirectBackToUrl}`
100100
})
101101
}
102102

0 commit comments

Comments
 (0)