Skip to content

Commit 06a9afb

Browse files
committed
fix url encoding on search param
1 parent a93d5b7 commit 06a9afb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pages/auth/login.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ export default function Login(props) {
3131
}
3232

3333
const redirectLang = props.locale === 'en' ? 'eng' : 'fra'
34-
const queryLangParam = new URLSearchParams(props.redirectQueryString).get(
35-
'Lang',
36-
)
37-
const langParam = queryLangParam ? '' : '&Lang=' + redirectLang
34+
const params = new URLSearchParams(props.redirectQueryString)
35+
if (!params.has('Lang')) {
36+
params.append('Lang', redirectLang)
37+
}
3838
const curamRedirect =
3939
props.ecasUrl +
4040
'/ecas-seca/rascl_iv/Curam/SAMLIdentityProvider.aspx?' +
41-
props.redirectQueryString +
42-
langParam
41+
params.toString()
4342
const redirectTarget = props.redirectQueryString
4443
? curamRedirect
4544
: props.locale === 'en'

0 commit comments

Comments
 (0)