Merge pull request #1109 from matrix-org/rav/fix_cas_login
Avoid getting stuck in a loop in CAS login
This commit is contained in:
commit
6a2c2d64fa
1 changed files with 10 additions and 3 deletions
13
src/Login.js
13
src/Login.js
|
@ -178,11 +178,18 @@ export default class Login {
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectToCas() {
|
redirectToCas() {
|
||||||
var client = this._createTemporaryClient();
|
const client = this._createTemporaryClient();
|
||||||
var parsedUrl = url.parse(window.location.href, true);
|
const parsedUrl = url.parse(window.location.href, true);
|
||||||
|
|
||||||
|
// XXX: at this point, the fragment will always be #/login, which is no
|
||||||
|
// use to anyone. Ideally, we would get the intended fragment from
|
||||||
|
// MatrixChat.screenAfterLogin so that you could follow #/room links etc
|
||||||
|
// through a CAS login.
|
||||||
|
parsedUrl.hash = "";
|
||||||
|
|
||||||
parsedUrl.query["homeserver"] = client.getHomeserverUrl();
|
parsedUrl.query["homeserver"] = client.getHomeserverUrl();
|
||||||
parsedUrl.query["identityServer"] = client.getIdentityServerUrl();
|
parsedUrl.query["identityServer"] = client.getIdentityServerUrl();
|
||||||
var casUrl = client.getCasLoginUrl(url.format(parsedUrl));
|
const casUrl = client.getCasLoginUrl(url.format(parsedUrl));
|
||||||
window.location.href = casUrl;
|
window.location.href = casUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue