fix / sso: after complete login via token make sure to delete only loginToken query-param from the window.location api.
Related to https://github.com/vector-im/element-web/pull/16292 Signed-off-by: Bekliev Parviz <nightkon95@gmail.com>
This commit is contained in:
parent
2332cecb59
commit
3e57378631
1 changed files with 5 additions and 2 deletions
|
@ -120,8 +120,11 @@ function onTokenLoginCompleted() {
|
||||||
// if we did a token login, we're now left with the token, hs and is
|
// if we did a token login, we're now left with the token, hs and is
|
||||||
// url as query params in the url; a little nasty but let's redirect to
|
// url as query params in the url; a little nasty but let's redirect to
|
||||||
// clear them.
|
// clear them.
|
||||||
const parsedUrl = url.parse(window.location.href);
|
const parsedUrl = url.parse(window.location.href, true);
|
||||||
parsedUrl.search = "";
|
|
||||||
|
parsedUrl.search = null; // to make `url.format` ignores `search` property and uses `query` instead
|
||||||
|
delete parsedUrl.query['loginToken'];
|
||||||
|
|
||||||
const formatted = url.format(parsedUrl);
|
const formatted = url.format(parsedUrl);
|
||||||
console.log(`Redirecting to ${formatted} to drop loginToken from queryparams`);
|
console.log(`Redirecting to ${formatted} to drop loginToken from queryparams`);
|
||||||
window.history.replaceState(null, "", formatted);
|
window.history.replaceState(null, "", formatted);
|
||||||
|
|
Loading…
Reference in a new issue