Incorporate review
parent
adb38c0aa9
commit
45409c2ef3
|
@ -52,23 +52,19 @@ var show_login = function() {
|
||||||
var this_page = window.location.origin + window.location.pathname;
|
var this_page = window.location.origin + window.location.pathname;
|
||||||
$("#sso_redirect_url").val(this_page);
|
$("#sso_redirect_url").val(this_page);
|
||||||
|
|
||||||
if (matrixLogin.serverAcceptsCas) {
|
if (matrixLogin.serverAcceptsSso) {
|
||||||
$("#sso_form").attr("action", "/_matrix/client/r0/login/cas/redirect");
|
if (try_token() || matrixLogin.serverAcceptsPassword) {
|
||||||
}
|
// Show the SSO form if there's a login token in the query. That's because,
|
||||||
|
// if there is a token, and this function is run, it means an error happened,
|
||||||
if ((matrixLogin.serverAcceptsSso || matrixLogin.serverAcceptsCas)) {
|
// and in this case it's nicer to show the form with an error rather than
|
||||||
if (try_token()) {
|
// redirect immediately to the SSO portal.
|
||||||
// Only show the SSO form if there's a login token in the query. That's
|
// Also show the form if the server is accepting password login as well.
|
||||||
// because, if there is a token, and this function is run, it means an error
|
|
||||||
// happened, and in this case it's nicer to show the form with an error
|
|
||||||
// rather than redirect immediately to the SSO portal.
|
|
||||||
$("#sso_form").show();
|
$("#sso_form").show();
|
||||||
} else {
|
} else {
|
||||||
// Submit the SSO form instead of displaying it. The reason behind this
|
// Submit the SSO form instead of displaying it. The reason behind this
|
||||||
// behaviour is that the user will likely arrive here after clicking on a
|
// behaviour is that the user will likely arrive here after clicking on a
|
||||||
// button, in the client, with a label such as "Continue with SSO". And even
|
// button, in the client, with a label such as "Continue with SSO", so
|
||||||
// if that's not the case, it kind of makes sense to direct the user directly
|
// clicking on another button with the same semantics is a bit pointless.
|
||||||
// to the SSO portal and skip the password login form.
|
|
||||||
$("#sso_form").submit();
|
$("#sso_form").submit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue