Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: enable full page login by default (#31771)

Penar Musaraj6aaddcf38131
diff --git a/app/assets/javascripts/discourse/app/controllers/signup.js b/app/assets/javascripts/discourse/app/controllers/signup.js
index ea65a944cdf..f52b0ec5d18 100644
--- a/app/assets/javascripts/discourse/app/controllers/signup.js
+++ b/app/assets/javascripts/discourse/app/controllers/signup.js
@@ -186,11 +186,10 @@ export default class SignupPageController extends Controller {
return this.passwordValidation.ok || this.passwordValidation.reason;
}
- @discourseComputed("usernameValidation.reason")
- showUsernameInstructions(usernameValidationReason) {
+ get showUsernameInstructions() {
return (
this.siteSettings.show_signup_form_username_instructions &&
- !usernameValidationReason
+ !this.usernameValidation.reason
);
}
diff --git a/app/assets/javascripts/discourse/tests/acceptance/auth-complete-test.js b/app/assets/javascripts/discourse/tests/acceptance/auth-complete-test.js
index a9522b21c59..75a3119ef0d 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/auth-complete-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/auth-complete-test.js
@@ -23,13 +23,11 @@ acceptance("Auth Complete", function (needs) {
assert.strictEqual(
currentRouteName(),
- "discovery.latest",
- "it stays on the homepage"
+ "signup",
+ "it goes to the signup page"
);
- assert
- .dom(".d-modal.create-account")
- .exists("it shows the registration modal");
+ assert.dom(".signup-fullpage").exists("it shows the signup page");
});
test("when login required", async function (assert) {
@@ -38,13 +36,11 @@ acceptance("Auth Complete", function (needs) {
assert.strictEqual(
currentRouteName(),
- "login",
- "it redirects to the login page"
+ "signup",
+ "it redirects to the signup page"
);
- assert
- .dom(".d-modal.create-account")
- .exists("it shows the registration modal");
+ assert.dom(".signup-fullpage").exists("it shows the signup page");
});
test("Callback added using addBeforeAuthCompleteCallback", async function (assert) {
@@ -64,9 +60,5 @@ acceptance("Auth Complete", function (needs) {
"discovery.categories",
"The function added via API was run and it transitioned to 'discovery.categories' route"
);
-
- assert
- .dom(".d-modal.create-account")
- .doesNotExist("registration modal is not shown");
});
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/create-account-external-test.js b/app/assets/javascripts/discourse/tests/acceptance/create-account-external-test.js
index 8db22b9aa43..4c81e97023c 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/create-account-external-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/create-account-external-test.js
@@ -28,9 +28,7 @@ acceptance("Create Account - external auth", function (needs) {
test("when skip is disabled (default)", async function (assert) {
await visit("/");
- assert
- .dom(".d-modal.create-account")
- .exists("it shows the registration modal");
+ assert.dom(".signup-fullpage").exists("it shows the signup page");
assert.dom("#new-account-username").exists("it shows the fields");
@@ -43,9 +41,7 @@ acceptance("Create Account - external auth", function (needs) {
this.siteSettings.auth_skip_create_confirm = true;
await visit("/");
- assert
- .dom(".d-modal.create-account")
- .exists("it shows the registration modal");
+ assert.dom(".signup-fullpage").exists("it shows the signup page");
assert
.dom("#new-account-username")
@@ -64,9 +60,7 @@ acceptance("Create account - with associate link", function (needs) {
test("displays associate link when allowed", async function (assert) {
await visit("/");
- assert
- .dom(".d-modal.create-account")
- .exists("it shows the registration modal");
+ assert.dom(".signup-fullpage").exists("it shows the signup page");
assert.dom("#new-account-username").exists("it shows the fields");
assert
.dom(".create-account-associate-link")
diff --git a/app/assets/javascripts/discourse/tests/acceptance/create-account-from-login-test.js b/app/assets/javascripts/discourse/tests/acceptance/create-account-from-login-test.js
index 6726ca56a87..0c40d201a6b 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/create-account-from-login-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/create-account-from-login-test.js
@@ -7,7 +7,8 @@ acceptance("Create Account Fields - From Login Form", function () {
await visit("/");
await click("header .login-button");
await fillIn("#login-account-name", "[email protected]");
- await click(".d-modal__footer #new-account-link");
+
+ await click("#new-account-link");
assert.dom("#new-account-username").hasText("");
assert
@@ -19,7 +20,7 @@ acceptance("Create Account Fields - From Login Form", function () {
await visit("/");
await click("header .login-button");
await fillIn("#login-account-name", "isaac");
- await click(".d-modal__footer #new-account-link");
+ await click("#new-account-link");
assert.dom("#new-account-email").hasText("");
assert
diff --git a/app/assets/javascripts/discourse/tests/acceptance/create-account-test.js b/app/assets/javascripts/discourse/tests/acceptance/create-account-test.js
index d23560c5998..327bcf7a755 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/create-account-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/create-account-test.js
@@ -15,7 +15,7 @@ acceptance("Create Account", function () {
await visit("/");
await click("header .sign-up-button");
- assert.dom(".create-account").exists("it shows the create account modal");
+ assert.dom(".signup-fullpage").exists("it shows the signup page");
await fillIn("#new-account-name", "Dr. Good Tuna");
await fillIn("#new-account-password", "cool password bro");
@@ -30,7 +30,7 @@ acceptance("Create Account", function () {
assert
.dom("#username-validation.bad")
.exists("the username validation is bad");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
await fillIn("#new-account-username", "good-tuna");
assert
@@ -47,9 +47,9 @@ acceptance("Create Account", function () {
return response({ success: true });
});
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
@@ -60,7 +60,7 @@ acceptance("Create Account", function () {
await click("header .sign-up-button");
await fillIn("#new-account-email", "[email protected]");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
.dom("#username-validation")
@@ -98,9 +98,10 @@ acceptance("Create Account", function () {
.hasText(i18n("user.name.instructions_required"));
await fillIn("#new-account-email", "[email protected]");
+ await fillIn("#new-account-username", "");
await fillIn("#new-account-password", "supersecurepassword");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert.dom("#username-validation").hasText(i18n("user.username.required"));
@@ -129,7 +130,7 @@ acceptance("Create Account", function () {
await click("header .sign-up-button");
assert
- .dom(".d-modal.create-account .btn-primary")
+ .dom(".signup-fullpage .btn-primary")
.exists("create account button exists");
assert.dom(".passkey-login-button").doesNotExist();
@@ -149,7 +150,7 @@ acceptance("Create Account - full name requirement", function () {
await fillIn("#new-account-username", "good-tuna");
await fillIn("#new-account-password", "cool password bro");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert.dom("#fullname-validation").hasText(i18n("user.name.required"));
await fillIn("#new-account-name", "Full Name");
@@ -164,9 +165,9 @@ acceptance("Create Account - full name requirement", function () {
return response({ success: true });
});
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
@@ -195,9 +196,9 @@ acceptance("Create Account - full name requirement", function () {
return response({ success: true });
});
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
@@ -226,9 +227,9 @@ acceptance("Create Account - full name requirement", function () {
return response({ success: true });
});
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".signup-fullpage .btn-primary")
.isDisabled("create account is disabled");
assert.verifySteps(["request"]);
diff --git a/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.js b/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.js
index 1548948567c..d7c8fc6de35 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/create-account-user-fields-test.js
@@ -1,5 +1,5 @@
import EmberObject from "@ember/object";
-import { click, fillIn, triggerKeyEvent, visit } from "@ember/test-helpers";
+import { click, fillIn, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { withPluginApi } from "discourse/lib/plugin-api";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
@@ -55,10 +55,10 @@ acceptance("Create Account - User Fields", function (needs) {
await visit("/");
await click("header .sign-up-button");
- assert.dom(".create-account").exists("it shows the create account modal");
+ assert.dom(".signup-fullpage").exists("it shows the signup page");
assert.dom(".user-field").exists("it has at least one user field");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
.dom("#account-email-validation")
.hasText(i18n("user.email.required"));
@@ -75,20 +75,10 @@ acceptance("Create Account - User Fields", function (needs) {
.dom("#account-email-validation.good")
.exists("the email validation is good");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
await fillIn(".user-field input[type=text]:nth-of-type(1)", "Barky");
await click(".user-field input[type=checkbox]");
- await click(".d-modal__footer .btn-primary");
- });
-
- test("can submit with enter", async function (assert) {
- await visit("/");
- await click("header .sign-up-button");
- await triggerKeyEvent("#new-account-email", "keydown", "Enter");
-
- assert
- .dom("#account-email-validation")
- .hasText(i18n("user.email.required"), "hitting Enter triggers action");
+ await click(".signup-fullpage .btn-primary");
});
test("shows validation error for user fields", async function (assert) {
@@ -98,7 +88,7 @@ acceptance("Create Account - User Fields", function (needs) {
await fillIn("#new-account-password", "cool password bro");
await fillIn(".user-field-whats-your-dad-like input", "cool password bro");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
.dom(".user-field-what-is-your-pets-name .tip.bad")
@@ -125,7 +115,7 @@ acceptance("Create Account - User Fields", function (needs) {
"it does not show error message until the form is submitted"
);
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
.dom(".user-field-what-is-your-favorite-color .tip.bad")
@@ -146,7 +136,7 @@ acceptance("Create Account - User Fields", function (needs) {
await fillIn(".user-field input[type=text]:nth-of-type(1)", "Barky");
await click(".user-field input[type=checkbox]");
- await click(".d-modal__footer .btn-primary");
+ await click(".signup-fullpage .btn-primary");
assert
.dom(".user-field-what-is-your-favorite-color .tip.bad")
.hasText(
diff --git a/app/assets/javascripts/discourse/tests/acceptance/groups-index-test.js b/app/assets/javascripts/discourse/tests/acceptance/groups-index-test.js
index 081cae9826d..fd149cc251d 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/groups-index-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/groups-index-test.js
@@ -15,13 +15,10 @@ acceptance("Groups", function () {
.exists("shows button to request for group membership");
await click(".group-index-join");
- assert.dom(".modal.login-modal").exists("shows the login modal");
- await click(".login-modal .modal-close");
- assert.dom(".modal.login-modal").doesNotExist("closes the login modal");
+ assert.dom(".login-fullpage").exists("shows the login page");
- await click(".group-index-request");
- assert.dom(".modal.login-modal").exists("shows the login modal");
+ await visit("/g");
await click("a[href='/g/discourse/members']");
assert
@@ -29,6 +26,6 @@ acceptance("Groups", function () {
.hasText("Awesome Team", "it displays the group page");
await click(".group-index-join");
- assert.dom(".modal.login-modal").exists("shows the login modal");
+ assert.dom(".login-fullpage").exists("shows the login page");
});
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/login-redirect-test.js b/app/assets/javascripts/discourse/tests/acceptance/login-redirect-test.js
index 04306f81c2f..979e8d9cd6d 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/login-redirect-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/login-redirect-test.js
@@ -2,7 +2,9 @@ import { currentRouteName, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
-acceptance("Login redirect - anonymous", function () {
+acceptance("Login redirect - anonymous", function (needs) {
+ needs.settings({ full_page_login: false });
+
test("redirects login to default homepage", async function (assert) {
await visit("/login");
assert.strictEqual(
@@ -16,6 +18,7 @@ acceptance("Login redirect - anonymous", function () {
acceptance("Login redirect - categories default", function (needs) {
needs.settings({
top_menu: "categories|latest|top|hot",
+ full_page_login: false,
});
test("when site setting is categories", async function (assert) {
diff --git a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.js b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.js
index 0a0cf72e32d..69ffe2e1434 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-test.js
@@ -4,7 +4,11 @@ import sinon from "sinon";
import { acceptance, chromeTest } from "discourse/tests/helpers/qunit-helpers";
import { i18n } from "discourse-i18n";
-acceptance("Modal - Login", function () {
+acceptance("Modal - Login", function (needs) {
+ needs.settings({
+ full_page_login: false,
+ });
+
chromeTest("You can tab to the login button", async function (assert) {
await visit("/");
await click("header .login-button");
@@ -19,6 +23,7 @@ acceptance("Modal - Login", function () {
acceptance("Modal - Login - With 2FA", function (needs) {
needs.settings({
enable_local_logins_via_email: true,
+ full_page_login: false,
});
needs.pretender((server, helper) => {
@@ -46,7 +51,7 @@ acceptance("Modal - Login - With 2FA", function (needs) {
});
});
-acceptance("Modal - Login - With Passkeys enabled", function () {
+acceptance("Login - With Passkeys enabled", function () {
test("Includes passkeys button and conditional UI", async function (assert) {
await visit("/");
await click("header .login-button");
@@ -73,7 +78,7 @@ acceptance("Modal - Login - With Passkeys disabled", function (needs) {
});
});
-acceptance("Modal - Login - Passkeys on mobile", function (needs) {
+acceptance("Login - Passkeys on mobile", function (needs) {
needs.mobileView();
test("Includes passkeys button and conditional UI", async function (assert) {
@@ -96,7 +101,7 @@ acceptance("Modal - Login - Passkeys on mobile", function (needs) {
});
});
-acceptance("Modal - Login - With no way to login", function (needs) {
+acceptance("Login - With no way to login", function (needs) {
needs.settings({
enable_local_logins: false,
enable_facebook_logins: false,
diff --git a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.js b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.js
index 131210f90ea..d237c67af62 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-test.js
@@ -49,7 +49,7 @@ acceptance("Login with email", function (needs) {
await fillIn("#login-account-name", "someuser");
await click("#email-login-link");
- assert.dom("#modal-alert").hasHtml(
+ assert.dom(".alert-error").hasHtml(
i18n("email_login.complete_username_not_found", {
username: "someuser",
}),
@@ -59,7 +59,7 @@ acceptance("Login with email", function (needs) {
await fillIn("#login-account-name", "[email protected]");
await click("#email-login-link");
- assert.dom("#modal-alert").hasHtml(
+ assert.dom(".alert-error").hasHtml(
i18n("email_login.complete_email_not_found", {
}),
diff --git a/app/assets/javascripts/discourse/tests/acceptance/new-message-test.js b/app/assets/javascripts/discourse/tests/acceptance/new-message-test.js
index d441eb2fe54..448839324ef 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/new-message-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/new-message-test.js
@@ -9,7 +9,7 @@ acceptance("New Message - Anonymous", function () {
"/new-message?username=charlie&title=message%20title&body=message%20body"
);
- assert.dom(".modal.login-modal").exists("shows the login modal");
+ assert.dom(".login-fullpage").exists("shows the login page");
});
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/new-topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/new-topic-test.js
index d606c9219fa..00c11bab9f5 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/new-topic-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/new-topic-test.js
@@ -5,9 +5,18 @@ import selectKit from "discourse/tests/helpers/select-kit-helper";
acceptance("New Topic - Anonymous", function () {
test("accessing new-topic route when logged out", async function (assert) {
- await visit("/new-topic?title=topic%20title&body=topic%20body");
+ try {
+ await visit("/new-topic?title=topic%20title&body=topic%20body");
+ } catch (error) {
+ assert.strictEqual(
+ error.message,
+ "TransitionAborted",
+ "it aborts the transition"
+ );
+ }
- assert.dom(".modal.login-modal").exists("shows the login modal");
+ assert.strictEqual(currentURL(), "/login");
+ assert.dom(".login-fullpage").exists("shows the login page");
});
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/sign-in-test.js b/app/assets/javascripts/discourse/tests/acceptance/sign-in-test.js
index ffa5d394d7f..8dc3a396022 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/sign-in-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/sign-in-test.js
@@ -6,15 +6,15 @@ acceptance("Signing In", function () {
test("sign in", async function (assert) {
await visit("/");
await click("header .login-button");
- assert.dom(".login-modal").exists("shows the login modal");
+ assert.dom(".login-fullpage").exists("shows the login modal");
// Test invalid password first
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "incorrect");
- await click(".d-modal__footer .btn-primary");
- assert.dom("#modal-alert").exists("displays the login error");
+ await click(".login-fullpage .btn-primary");
+ assert.dom(".alert-error").exists("displays the login error");
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".login-fullpage .btn-primary")
.isEnabled("enables the login button");
// Test password unmasking
@@ -28,20 +28,20 @@ acceptance("Signing In", function () {
// Use the correct password
await fillIn("#login-account-password", "correct");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".login-fullpage .btn-primary")
.isDisabled("disables the login button");
});
test("sign in - not activated", async function (assert) {
await visit("/");
await click("header .login-button");
- assert.dom(".login-modal").exists("shows the login modal");
+ assert.dom(".login-fullpage").exists("shows the login modal");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "not-activated");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
assert
.dom(".d-modal__body b")
.hasText("<small>[email protected]</small>");
@@ -61,11 +61,12 @@ acceptance("Signing In", function () {
test("sign in - not activated - edit email", async function (assert) {
await visit("/");
await click("header .login-button");
- assert.dom(".login-modal").exists("shows the login modal");
+ assert.dom(".login-fullpage").exists("shows the login page");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "not-activated-edit");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
+
await click(".d-modal__footer button.edit-email");
assert.dom(".activate-new-email").hasValue("[email protected]");
assert.dom(".d-modal__footer .btn-primary").isDisabled("must change email");
@@ -81,25 +82,26 @@ acceptance("Signing In", function () {
await visit("/");
await click("header .login-button");
- assert.dom(".login-modal").exists("shows the login modal");
+ assert.dom(".login-fullpage").exists("shows the login page");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-second-factor");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
assert
.dom("#credentials")
.isNotVisible("hides the username and password prompt");
assert.dom("#second-factor").isVisible("displays the second factor prompt");
+
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".login-fullpage .btn-primary")
.isEnabled("enables the login button");
await fillIn("#login-second-factor", "123456");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
assert
- .dom(".d-modal__footer .btn-primary")
+ .dom(".login-fullpage .btn-primary")
.isDisabled("disables the login button");
});
@@ -107,11 +109,11 @@ acceptance("Signing In", function () {
await visit("/");
await click("header .login-button");
- assert.dom(".login-modal").exists("shows the login modal");
+ assert.dom(".login-fullpage").exists("shows the login page");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-security-key");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
assert
.dom("#credentials")
@@ -128,12 +130,12 @@ acceptance("Signing In", function () {
await click("header .login-button");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-second-factor");
- await click(".d-modal__footer .btn-primary");
- await click(".login-modal .toggle-second-factor-method");
+ await click(".login-fullpage .btn-primary");
+ await click(".login-fullpage .toggle-second-factor-method");
await fillIn("#login-second-factor", "123456");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
- assert.dom(".d-modal__footer .btn-primary").isDisabled();
+ assert.dom(".login-fullpage .btn-primary").isDisabled();
});
test("second factor backup - invalid token", async function (assert) {
@@ -141,13 +143,13 @@ acceptance("Signing In", function () {
await click("header .login-button");
await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "need-second-factor");
- await click(".d-modal__footer .btn-primary");
- await click(".login-modal .toggle-second-factor-method");
+ await click(".login-fullpage .btn-primary");
+ await click(".login-fullpage .toggle-second-factor-method");
await fillIn("#login-second-factor", "something");
- await click(".d-modal__footer .btn-primary");
+ await click(".login-fullpage .btn-primary");
assert
- .dom("#modal-alert")
+ .dom(".alert-error")
.exists("shows an error when the code is invalid");
});
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/static-test.js b/app/assets/javascripts/discourse/tests/acceptance/static-test.js
index 1385ec5bb8b..9eb3c7283e2 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/static-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/static-test.js
@@ -42,6 +42,7 @@ acceptance("Static pages", function () {
});
test("Login redirect", async function (assert) {
+ this.siteSettings.full_page_login = false;
await visit("/login");
assert.strictEqual(
@@ -62,6 +63,7 @@ acceptance("Static pages", function () {
});
test("Signup redirect", async function (assert) {
+ this.siteSettings.full_page_login = false;
await visit("/signup");
assert.strictEqual(
@@ -72,6 +74,7 @@ acceptance("Static pages", function () {
});
test("Signup redirect with login_required", async function (assert) {
+ this.siteSettings.full_page_login = false;
this.siteSettings.login_required = true;
await visit("/signup");
diff --git a/app/models/problem_check.rb b/app/models/problem_check.rb
index 59aaef47419..02f8cb78507 100644
--- a/app/models/problem_check.rb
+++ b/app/models/problem_check.rb
@@ -66,6 +66,7 @@ class ProblemCheck
ProblemCheck::FacebookConfig,
ProblemCheck::FailingEmails,
ProblemCheck::ForceHttps,
+ ProblemCheck::FullPageLoginCheck,
ProblemCheck::GithubConfig,
ProblemCheck::GoogleAnalyticsVersion,
ProblemCheck::GoogleOauth2Config,
diff --git a/app/services/problem_check/full_page_login_check.rb b/app/services/problem_check/full_page_login_check.rb
new file mode 100644
index 00000000000..355d57f940f
--- /dev/null
+++ b/app/services/problem_check/full_page_login_check.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class ProblemCheck::FullPageLoginCheck < ProblemCheck
+ self.priority = "low"
+
+ def call
+ if full_page_login_disabled?
+ return problem(override_key: "dashboard.problem.full_page_login_check")
+ end
+
+ no_problem
+ end
+
+ private
+
+ def full_page_login_disabled?
+ SiteSetting.full_page_login == false
+ end
+end
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 00b24e624b9..65fd7726b9d 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -1735,6 +1735,7 @@ en:
category_style_deprecated: "Your Discourse is currently using a deprecated category style which will be removed before the final beta release of Discourse 3.2. Please refer to <a href='https://meta.discourse.org/t/282441'>Moving to a Single Category Style Site Setting</a> for instructions on how to keep your selected category style."
maxmind_db_configuration: 'The server has been configured to use MaxMind databases for reverse IP lookups but a valid MaxMind account ID has not been configured which may result in MaxMind databases failing to download in the future. <a href="https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941" target="_blank">See this guide to learn more</a>.'
admin_sidebar_deprecation: "The old admin layout is deprecated in favour of the new <a href='https://meta.discourse.org/t/-/289281'>sidebar layout</a> and will be removed in the next release. You can <a href='%{base_path}/admin/config/navigation?filter=admin%20sidebar'>configure</a> the new sidebar layout now to opt in before that."
+ full_page_login_check: "Your site has disabled the full page login setting. This setting is deprecated and will be removed on <strong>29 April 2025</strong>. Your site will be updated to use full page signup and login screens on that date. <a href='https://meta.discourse.org/t/introducing-our-new-fullscreen-signup-and-login-pages/340401'>Learn more</a>."
back_from_logster_text: "Back to site"
site_settings:
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 101fcfff5f1..4533ddfab84 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -689,7 +689,7 @@ login:
min: 1
max: 175200
full_page_login:
- default: false
+ default: true
client: true
show_signup_form_email_instructions:
client: true
diff --git a/spec/services/problem_check/full_page_login_check_spec.rb b/spec/services/problem_check/full_page_login_check_spec.rb
new file mode 100644
index 00000000000..63c21a5b0a8
--- /dev/null
+++ b/spec/services/problem_check/full_page_login_check_spec.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+RSpec.describe ProblemCheck::FullPageLoginCheck do
+ let(:check) { described_class.new }
+
+ describe "#call" do
+ context "when full_page_login is enabled" do
+ before { SiteSetting.full_page_login = true }
+
+ it { expect(check).to be_chill_about_it }
+ end
+
+ context "when full_page_login is enabled" do
+ before { SiteSetting.full_page_login = false }
+
+ it { expect(check).to have_a_problem.with_priority("low") }
+ end
+ end
+end
diff --git a/spec/system/create_account_spec.rb b/spec/system/create_account_spec.rb
deleted file mode 100644
index 76a4c815a28..00000000000
--- a/spec/system/create_account_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-describe "Create account", type: :system do
- it "creates a user account" do
- visit "/"
- click_button "Sign Up"
- expect(page).to have_css(".d-modal.create-account")
-
- find("#new-account-email").fill_in with: "[email protected]"
-
- find("#new-account-username").fill_in with: "user1"
- expect(page.find("#username-validation")).to have_content("Your username is available")
-
- find("#new-account-password").fill_in with: "secret-password"
-
- find(".d-modal.create-account").click_button "Sign Up"
- expect(page).to have_no_css(".d-modal.create-account")
-
- user = User.last
- expect(user.username).to eq("user1")
- expect(user.emails).to eq(["[email protected]"])
- end
-end
diff --git a/spec/system/email_change_spec.rb b/spec/system/email_change_spec.rb
index aa558e59c36..4af59c10816 100644
--- a/spec/system/email_change_spec.rb
+++ b/spec/system/email_change_spec.rb
@@ -103,7 +103,8 @@ describe "Changing email", type: :system do
authenticator&.remove!
end
- it "does not require login to verify" do
+ it "does not require login to confirm email change" do
+ SiteSetting.full_page_login = false
second_factor = Fabricate(:user_second_factor_totp, user: user)
sign_in user
diff --git a/spec/system/forgot_password_spec.rb b/spec/system/forgot_password_spec.rb
index 362396b1913..d61b3987dcf 100644
--- a/spec/system/forgot_password_spec.rb
+++ b/spec/system/forgot_password_spec.rb
@@ -3,7 +3,6 @@
require "rotp"
shared_examples "forgot password scenarios" do
- let(:login_modal) { PageObjects::Modals::Login.new }
let(:user_preferences_security_page) { PageObjects::Pages::UserPreferencesSecurity.new }
fab!(:user) { Fabricate(:user, username: "john", password: "supersecurepassword") }
fab!(:password_reset_token) do
diff --git a/spec/system/header_spec.rb b/spec/system/header_spec.rb
index bb46bd67cdd..4c656e5f3c6 100644
--- a/spec/system/header_spec.rb
+++ b/spec/system/header_spec.rb
@@ -12,18 +12,22 @@ RSpec.describe "Glimmer Header", type: :system do
expect(page).to have_css("#site-logo")
end
- it "displays sign up / login buttons" do
+ it "displays sign up button" do
visit "/"
expect(page).to have_css("button.sign-up-button")
expect(page).to have_css("button.login-button")
find("button.sign-up-button").click
- expect(page).to have_css(".d-modal.create-account")
+ expect(page).to have_css(".signup-fullpage")
+ end
- header.click_outside
+ it "displays login button" do
+ visit "/"
+ expect(page).to have_css("button.sign-up-button")
+ expect(page).to have_css("button.login-button")
find("button.login-button").click
- expect(page).to have_css(".d-modal.login-modal")
+ expect(page).to have_css(".login-fullpage")
end
it "shows login button when login required" do
diff --git a/spec/system/login_spec.rb b/spec/system/login_spec.rb
index 2c10e566805..bb47bc04a81 100644
--- a/spec/system/login_spec.rb
+++ b/spec/system/login_spec.rb
@@ -360,10 +360,12 @@ end
describe "Login", type: :system do
context "when desktop" do
+ before { SiteSetting.full_page_login = false }
include_examples "login scenarios", PageObjects::Modals::Login.new
end
context "when mobile", mobile: true do
+ before { SiteSetting.full_page_login = false }
include_examples "login scenarios", PageObjects::Modals::Login.new
end
diff --git a/spec/system/post_menu_spec.rb b/spec/system/post_menu_spec.rb
index 243dd4b20fd..4036490dcdf 100644
--- a/spec/system/post_menu_spec.rb
+++ b/spec/system/post_menu_spec.rb
@@ -10,7 +10,7 @@ describe "Post menu", type: :system do
let(:composer) { PageObjects::Components::Composer.new }
let(:topic_page) { PageObjects::Pages::Topic.new }
let(:flag_modal) { PageObjects::Modals::Flag.new }
- let(:login_modal) { PageObjects::Modals::Login.new }
+ let(:login_page) { PageObjects::Pages::Login.new }
let(:modal) { PageObjects::Modals::Base.new }
%w[enabled disabled].each do |value|
@@ -462,7 +462,7 @@ describe "Post menu", type: :system do
# clicking on the like button should display the login modal
topic_page.click_post_action_button(post2, :like)
- expect(login_modal).to be_open
+ expect(login_page).to be_open
end
it "renders the like count as expected" do
diff --git a/spec/system/signup_spec.rb b/spec/system/signup_spec.rb
index fe1f9b2d637..11c076b33c3 100644
--- a/spec/system/signup_spec.rb
+++ b/spec/system/signup_spec.rb
@@ -350,12 +350,14 @@ end
describe "Signup", type: :system do
context "when desktop" do
+ before { SiteSetting.full_page_login = false }
include_examples "signup scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
end
context "when mobile", mobile: true do
+ before { SiteSetting.full_page_login = false }
include_examples "signup scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
diff --git a/spec/system/social_authentication_spec.rb b/spec/system/social_authentication_spec.rb
index 1a2cf4821a0..6456eebb35c 100644
--- a/spec/system/social_authentication_spec.rb
+++ b/spec/system/social_authentication_spec.rb
@@ -455,12 +455,14 @@ describe "Social authentication", type: :system do
before { SiteSetting.full_name_requirement = "optional_at_signup" }
context "when desktop" do
+ before { SiteSetting.full_page_login = false }
include_examples "social authentication scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
end
context "when mobile", mobile: true do
+ before { SiteSetting.full_page_login = false }
include_examples "social authentication scenarios",
PageObjects::Modals::Signup.new,
PageObjects::Modals::Login.new
diff --git a/spec/system/user_page/user_preferences_security_spec.rb b/spec/system/user_page/user_preferences_security_spec.rb
index 84ef02a3416..e96ef406d41 100644
--- a/spec/system/user_page/user_preferences_security_spec.rb
+++ b/spec/system/user_page/user_preferences_security_spec.rb
@@ -41,7 +41,7 @@ describe "User preferences | Security", type: :system do
find("input#login-account-name").fill_in(with: user.username)
find("input#login-account-password").fill_in(with: password)
- find(".d-modal__footer .btn-primary").click
+ find("#login-button.btn-primary").click
find("#security-key .btn-primary").click
expect(page).to have_css(".header-dropdown-toggle.current-user")