FIX: Ensure the signup boolean is passed when started via _autoLogin (#12338)

The signup boolean was being passed in the third _autoLogin argument, when it should have been the fourth. The third parameter to _autoLogin was optional, which is confusing. This commit cleans things up so both optional arguments are supplied via keywords.

Followup to cbef2ba151
This commit is contained in:
David Taylor 2021-03-10 15:39:14 +00:00 committed by GitHub
parent 942e8bac4f
commit a52a863fc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,9 +247,9 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
const returnPath = encodeURIComponent(window.location.pathname);
window.location = getURL("/session/sso?return_path=" + returnPath);
} else {
this._autoLogin("login", "login-modal", () =>
this.controllerFor("login").resetForm()
);
this._autoLogin("login", "login-modal", {
notAuto: () => this.controllerFor("login").resetForm(),
});
}
},
@ -262,7 +262,7 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
}
},
_autoLogin(modal, modalClass, notAuto, { signup = false } = {}) {
_autoLogin(modal, modalClass, { notAuto = null, signup = false } = {}) {
const methods = findAll();
if (!this.siteSettings.enable_local_logins && methods.length === 1) {