A platform for community discussion. Free, open, simple.
Revert "DEV: Show login-required screen in root route (#32350)" (#32562)
Penar Musaraj82d84af6b0ef
diff --git a/app/assets/javascripts/discourse/app/controllers/discovery/login-required.js b/app/assets/javascripts/discourse/app/controllers/discovery/login-required.jsdeleted file mode 100644index 022c1613c14..00000000000--- a/app/assets/javascripts/discourse/app/controllers/discovery/login-required.js+++ /dev/null@@ -1,5 +0,0 @@-import Controller, { inject as controller } from "@ember/controller";--export default class LoginRequiredController extends Controller {- @controller application;-}diff --git a/app/assets/javascripts/discourse/app/lib/homepage-router-overrides.js b/app/assets/javascripts/discourse/app/lib/homepage-router-overrides.jsindex 1076d8528f8..d8a0def3d53 100644--- a/app/assets/javascripts/discourse/app/lib/homepage-router-overrides.js+++ b/app/assets/javascripts/discourse/app/lib/homepage-router-overrides.js@@ -35,7 +35,6 @@ function rewriteIfNeeded(url, transition) {const intentUrl = transition?.intent?.url;if (intentUrl?.startsWith(homepageDestination()) ||- intentUrl?.startsWith("/login-required") ||(transition?.intent.name === `discovery.${defaultHomepage()}` &&transition?.intent.queryParams[homepageRewriteParam])) {diff --git a/app/assets/javascripts/discourse/app/routes/app-route-map.js b/app/assets/javascripts/discourse/app/routes/app-route-map.jsindex 3321c871b8f..d83c3dcf779 100644--- a/app/assets/javascripts/discourse/app/routes/app-route-map.js+++ b/app/assets/javascripts/discourse/app/routes/app-route-map.js@@ -68,7 +68,6 @@ export default function () {this.route("category", { path: "/c/*category_slug_path_with_id" });this.route("custom");- this.route("login-required");});this.route("groups", { resetNamespace: true, path: "/g" }, function () {diff --git a/app/assets/javascripts/discourse/app/routes/application.js b/app/assets/javascripts/discourse/app/routes/application.jsindex 7454793a2ed..81f4bcb7cd8 100644--- a/app/assets/javascripts/discourse/app/routes/application.js+++ b/app/assets/javascripts/discourse/app/routes/application.js@@ -271,6 +271,9 @@ export default class ApplicationRoute extends DiscourseRoute {} else {this.router.transitionTo("login").then((login) => {login.controller.set("canSignUp", this.controller.canSignUp);+ if (this.siteSettings.login_required) {+ login.controller.set("showLogin", true);+ }});}}diff --git a/app/assets/javascripts/discourse/app/routes/discourse.js b/app/assets/javascripts/discourse/app/routes/discourse.jsindex 4ffba9a2c76..8cbeb029ab1 100644--- a/app/assets/javascripts/discourse/app/routes/discourse.js+++ b/app/assets/javascripts/discourse/app/routes/discourse.js@@ -36,6 +36,13 @@ export default class DiscourseRoute extends Route {once(this, this._refreshTitleOnce);}+ redirectIfLoginRequired() {+ const app = this.controllerFor("application");+ if (app.get("loginRequired")) {+ this.router.replaceWith("login");+ }+ }+isCurrentUser(user) {if (!this.currentUser) {return false; // the current user is anonymousdiff --git a/app/assets/javascripts/discourse/app/routes/discovery-login-required.js b/app/assets/javascripts/discourse/app/routes/discovery-login-required.jsdeleted file mode 100644index 927432856dc..00000000000--- a/app/assets/javascripts/discourse/app/routes/discovery-login-required.js+++ /dev/null@@ -1,8 +0,0 @@-import StaticPage from "discourse/models/static-page";-import DiscourseRoute from "discourse/routes/discourse";--export default class LoginRequiredRoute extends DiscourseRoute {- model() {- return StaticPage.find("login");- }-}diff --git a/app/assets/javascripts/discourse/app/routes/discovery.js b/app/assets/javascripts/discourse/app/routes/discovery.jsindex ca310fd0e95..87d745e4e3c 100644--- a/app/assets/javascripts/discourse/app/routes/discovery.js+++ b/app/assets/javascripts/discourse/app/routes/discovery.js@@ -11,17 +11,13 @@ export default class DiscoveryRoute extends DiscourseRoute {@service router;@service session;@service site;- @service siteSettings;queryParams = {filter: { refreshModel: true },};redirect() {- if (this.siteSettings.login_required && !this.currentUser) {- this.router.transitionTo("/login-required?_discourse_homepage_rewrite=1");- return;- }+ return this.redirectIfLoginRequired();}beforeModel(transition) {diff --git a/app/assets/javascripts/discourse/app/routes/login.js b/app/assets/javascripts/discourse/app/routes/login.jsindex 9077202282d..ac6d35cc3ff 100644--- a/app/assets/javascripts/discourse/app/routes/login.js+++ b/app/assets/javascripts/discourse/app/routes/login.js@@ -58,6 +58,10 @@ export default class LoginRoute extends DiscourseRoute {);}+ if (this.siteSettings.login_required) {+ controller.set("showLogin", false);+ }+if (this.login.isOnlyOneExternalLoginMethod) {if (this.siteSettings.auth_immediately) {controller.set("isRedirectingToExternalAuth", true);diff --git a/app/assets/javascripts/discourse/app/routes/topic.js b/app/assets/javascripts/discourse/app/routes/topic.jsindex e072fda8856..4ac337ccbdc 100644--- a/app/assets/javascripts/discourse/app/routes/topic.js+++ b/app/assets/javascripts/discourse/app/routes/topic.js@@ -48,6 +48,10 @@ export default class TopicRoute extends DiscourseRoute {};}+ redirect() {+ return this.redirectIfLoginRequired();+ }+titleToken() {const model = this.modelFor("topic");if (model) {diff --git a/app/assets/javascripts/discourse/app/templates/discovery/login-required.gjs b/app/assets/javascripts/discourse/app/templates/discovery/login-required.gjsdeleted file mode 100644index 201796744b7..00000000000--- a/app/assets/javascripts/discourse/app/templates/discovery/login-required.gjs+++ /dev/null@@ -1,62 +0,0 @@-import { hash } from "@ember/helper";-import { htmlSafe } from "@ember/template";-import RouteTemplate from "ember-route-template";-import DButton from "discourse/components/d-button";-import PluginOutlet from "discourse/components/plugin-outlet";-import bodyClass from "discourse/helpers/body-class";-import hideApplicationHeaderButtons from "discourse/helpers/hide-application-header-buttons";-import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";-import routeAction from "discourse/helpers/route-action";--export default RouteTemplate(- <template>- {{hideApplicationHeaderButtons "search" "login" "signup" "menu"}}- {{hideApplicationSidebar}}- {{bodyClass "login-page"}}- {{bodyClass "static-login"}}-- <section class="container">- <div class="contents clearfix body-page">- <div class="login-welcome">- <PluginOutlet- @name="above-login"- @outletArgs={{hash [email protected]}}- />- <PluginOutlet @name="above-static" />-- <div class="login-content">- {{htmlSafe @controller.model.html}}- </div>-- <PluginOutlet @name="below-static" />- <PluginOutlet- @name="below-login"- @outletArgs={{hash [email protected]}}- />-- <div class="body-page-button-container">- {{#if @controller.application.canSignUp}}- <DButton- @action={{routeAction "showCreateAccount"}}- @label="sign_up"- class="btn-primary sign-up-button"- />- {{/if}}-- <DButton- @action={{routeAction "showLogin"}}- @icon="user"- @label="log_in"- class="btn-primary login-button"- />- </div>-- <PluginOutlet- @name="below-login-buttons"- @outletArgs={{hash [email protected]}}- />- </div>- </div>- </section>- </template>-);diff --git a/app/assets/javascripts/discourse/app/templates/login.gjs b/app/assets/javascripts/discourse/app/templates/login.gjsindex 89b0e18dd3e..c180854188d 100644--- a/app/assets/javascripts/discourse/app/templates/login.gjs+++ b/app/assets/javascripts/discourse/app/templates/login.gjs@@ -1,7 +1,8 @@import { hash } from "@ember/helper";import { htmlSafe } from "@ember/template";import RouteTemplate from "ember-route-template";-import { and } from "truth-helpers";+import { and, not, or } from "truth-helpers";+import DButton from "discourse/components/d-button";import FlashMessage from "discourse/components/flash-message";import LocalLoginForm from "discourse/components/local-login-form";import LoginButtons from "discourse/components/login-buttons";@@ -13,6 +14,7 @@ import concatClass from "discourse/helpers/concat-class";import hideApplicationHeaderButtons from "discourse/helpers/hide-application-header-buttons";import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";import loadingSpinner from "discourse/helpers/loading-spinner";+import routeAction from "discourse/helpers/route-action";import { i18n } from "discourse-i18n";export default RouteTemplate(@@ -26,143 +28,201 @@ export default RouteTemplate({{! authentication method and is being automatically redirected to it }}{{loadingSpinner}}{{else}}- <div class="login-fullpage">- <FlashMessage- @flash={{@controller.flash}}- @type={{@controller.flashType}}- />-- <div class={{concatClass "login-body" @controller.bodyClasses}}>- <PluginOutlet- @name="login-before-modal-body"- @connectorTagName="div"- @outletArgs={{hash- flashChanged=this.flashChanged- flashTypeChanged=this.flashTypeChanged- }}+ {{#if+ (or @controller.showLogin (not @controller.siteSettings.login_required))+ }}+ {{! Show the full page login form }}+ <div class="login-fullpage">+ <FlashMessage+ @flash={{@controller.flash}}+ @type={{@controller.flashType}}/>- {{#if @controller.hasNoLoginOptions}}- <div class={{if @controller.site.desktopView "login-left-side"}}>- <div class="login-welcome-header no-login-methods-configured">- <h1 class="login-title">{{i18n- "login.no_login_methods.title"- }}</h1>- <img />- <p class="login-subheader">- {{htmlSafe- (i18n- "login.no_login_methods.description"- (hash [email protected])- )- }}- </p>- </div>- </div>- {{else}}- {{#if @controller.site.mobileView}}- <WelcomeHeader @header={{i18n "login.header_title"}}>- <PluginOutlet- @name="login-header-bottom"- @outletArgs={{hash [email protected]}}- />- </WelcomeHeader>- {{#if @controller.showLoginButtons}}- <LoginButtons- @externalLogin={{@controller.externalLoginAction}}- @passkeyLogin={{@controller.passkeyLogin}}- @context="login"- />- {{/if}}- {{/if}}+ <div class={{concatClass "login-body" @controller.bodyClasses}}>+ <PluginOutlet+ @name="login-before-modal-body"+ @connectorTagName="div"+ @outletArgs={{hash+ flashChanged=this.flashChanged+ flashTypeChanged=this.flashTypeChanged+ }}+ />- {{#if @controller.canLoginLocal}}+ {{#if @controller.hasNoLoginOptions}}<div class={{if @controller.site.desktopView "login-left-side"}}>- {{#if @controller.site.desktopView}}- <WelcomeHeader @header={{i18n "login.header_title"}}>- <PluginOutlet- @name="login-header-bottom"- @outletArgs={{hash- }}- />- </WelcomeHeader>- {{/if}}- <LocalLoginForm- @loginName={{@controller.loginName}}- @loginNameChanged={{@controller.loginNameChanged}}- @canLoginLocalWithEmail={{@controller.canLoginLocalWithEmail}}- @canUsePasskeys={{@controller.canUsePasskeys}}- @passkeyLogin={{@controller.passkeyLogin}}- @loginPassword={{@controller.loginPassword}}- @secondFactorMethod={{@controller.secondFactorMethod}}- @secondFactorToken={{@controller.secondFactorToken}}- @backupEnabled={{@controller.backupEnabled}}- @totpEnabled={{@controller.totpEnabled}}- @securityKeyAllowedCredentialIds={{@controller.securityKeyAllowedCredentialIds}}- @securityKeyChallenge={{@controller.securityKeyChallenge}}- @showSecurityKey={{@controller.showSecurityKey}}- @otherMethodAllowed={{@controller.otherMethodAllowed}}- @showSecondFactor={{@controller.showSecondFactor}}- @handleForgotPassword={{@controller.handleForgotPassword}}- @login={{@controller.triggerLogin}}- @flashChanged={{@controller.flashChanged}}- @flashTypeChanged={{@controller.flashTypeChanged}}- @securityKeyCredentialChanged={{@controller.securityKeyCredentialChanged}}- />- {{#if @controller.site.desktopView}}- <LoginPageCta- @canLoginLocal={{@controller.canLoginLocal}}- @showSecurityKey={{@controller.showSecurityKey}}- @login={{@controller.triggerLogin}}- @loginButtonLabel={{@controller.loginButtonLabel}}- @loginDisabled={{@controller.loginDisabled}}- @showSignupLink={{@controller.showSignupLink}}- @createAccount={{@controller.createAccount}}- @loggingIn={{@controller.loggingIn}}- @showSecondFactor={{@controller.showSecondFactor}}- />- {{/if}}- </div>- {{/if}}-- {{#if- (and @controller.showLoginButtons @controller.site.desktopView)- }}- {{#unless @controller.canLoginLocal}}- <div class="login-left-side">- <WelcomeHeader @header={{i18n "login.header_title"}} />+ <div class="login-welcome-header no-login-methods-configured">+ <h1 class="login-title">{{i18n+ "login.no_login_methods.title"+ }}</h1>+ <img />+ <p class="login-subheader">+ {{htmlSafe+ (i18n+ "login.no_login_methods.description"+ (hash [email protected])+ )+ }}+ </p></div>- {{/unless}}- {{#if @controller.hasAtLeastOneLoginButton}}- <div class="login-right-side">+ </div>+ {{else}}+ {{#if @controller.site.mobileView}}+ <WelcomeHeader @header={{i18n "login.header_title"}}>+ <PluginOutlet+ @name="login-header-bottom"+ @outletArgs={{hash [email protected]}}+ />+ </WelcomeHeader>+ {{#if @controller.showLoginButtons}}<LoginButtons@externalLogin={{@controller.externalLoginAction}}@passkeyLogin={{@controller.passkeyLogin}}@context="login"/>+ {{/if}}+ {{/if}}++ {{#if @controller.canLoginLocal}}+ <div+ class={{if @controller.site.desktopView "login-left-side"}}+ >+ {{#if @controller.site.desktopView}}+ <WelcomeHeader @header={{i18n "login.header_title"}}>+ <PluginOutlet+ @name="login-header-bottom"+ @outletArgs={{hash+ }}+ />+ </WelcomeHeader>+ {{/if}}+ <LocalLoginForm+ @loginName={{@controller.loginName}}+ @loginNameChanged={{@controller.loginNameChanged}}+ @canLoginLocalWithEmail={{@controller.canLoginLocalWithEmail}}+ @canUsePasskeys={{@controller.canUsePasskeys}}+ @passkeyLogin={{@controller.passkeyLogin}}+ @loginPassword={{@controller.loginPassword}}+ @secondFactorMethod={{@controller.secondFactorMethod}}+ @secondFactorToken={{@controller.secondFactorToken}}+ @backupEnabled={{@controller.backupEnabled}}+ @totpEnabled={{@controller.totpEnabled}}+ @securityKeyAllowedCredentialIds={{@controller.securityKeyAllowedCredentialIds}}+ @securityKeyChallenge={{@controller.securityKeyChallenge}}+ @showSecurityKey={{@controller.showSecurityKey}}+ @otherMethodAllowed={{@controller.otherMethodAllowed}}+ @showSecondFactor={{@controller.showSecondFactor}}+ @handleForgotPassword={{@controller.handleForgotPassword}}+ @login={{@controller.triggerLogin}}+ @flashChanged={{@controller.flashChanged}}+ @flashTypeChanged={{@controller.flashTypeChanged}}+ @securityKeyCredentialChanged={{@controller.securityKeyCredentialChanged}}+ />+ {{#if @controller.site.desktopView}}+ <LoginPageCta+ @canLoginLocal={{@controller.canLoginLocal}}+ @showSecurityKey={{@controller.showSecurityKey}}+ @login={{@controller.triggerLogin}}+ @loginButtonLabel={{@controller.loginButtonLabel}}+ @loginDisabled={{@controller.loginDisabled}}+ @showSignupLink={{@controller.showSignupLink}}+ @createAccount={{@controller.createAccount}}+ @loggingIn={{@controller.loggingIn}}+ @showSecondFactor={{@controller.showSecondFactor}}+ />+ {{/if}}</div>{{/if}}++ {{#if+ (and @controller.showLoginButtons @controller.site.desktopView)+ }}+ {{#unless @controller.canLoginLocal}}+ <div class="login-left-side">+ <WelcomeHeader @header={{i18n "login.header_title"}} />+ </div>+ {{/unless}}+ {{#if @controller.hasAtLeastOneLoginButton}}+ <div class="login-right-side">+ <LoginButtons+ @externalLogin={{@controller.externalLoginAction}}+ @passkeyLogin={{@controller.passkeyLogin}}+ @context="login"+ />+ </div>+ {{/if}}+ {{/if}}{{/if}}- {{/if}}- {{#if @controller.site.mobileView}}- {{#unless @controller.hasNoLoginOptions}}- <LoginPageCta- @canLoginLocal={{@controller.canLoginLocal}}- @showSecurityKey={{@controller.showSecurityKey}}- @login={{@controller.triggerLogin}}- @loginButtonLabel={{@controller.loginButtonLabel}}- @loginDisabled={{@controller.loginDisabled}}- @showSignupLink={{@controller.showSignupLink}}- @createAccount={{@controller.createAccount}}- @loggingIn={{@controller.loggingIn}}- @showSecondFactor={{@controller.showSecondFactor}}- />- {{/unless}}- {{/if}}+ {{#if @controller.site.mobileView}}+ {{#unless @controller.hasNoLoginOptions}}+ <LoginPageCta+ @canLoginLocal={{@controller.canLoginLocal}}+ @showSecurityKey={{@controller.showSecurityKey}}+ @login={{@controller.triggerLogin}}+ @loginButtonLabel={{@controller.loginButtonLabel}}+ @loginDisabled={{@controller.loginDisabled}}+ @showSignupLink={{@controller.showSignupLink}}+ @createAccount={{@controller.createAccount}}+ @loggingIn={{@controller.loggingIn}}+ @showSecondFactor={{@controller.showSecondFactor}}+ />+ {{/unless}}+ {{/if}}+ </div></div>- </div>++ {{else}}+ {{! Show the login-required splash screen }}+ {{bodyClass "static-login"}}+ <section class="container">+ <div class="contents clearfix body-page">+ <div class="login-welcome">+ <PluginOutlet+ @name="above-login"+ @outletArgs={{hash [email protected]}}+ />+ <PluginOutlet @name="above-static" />++ <div class="login-content">+ {{htmlSafe @controller.model.html}}+ </div>++ <PluginOutlet @name="below-static" />+ <PluginOutlet+ @name="below-login"+ @outletArgs={{hash [email protected]}}+ />++ <div class="body-page-button-container">+ {{#if @controller.application.canSignUp}}+ <DButton+ @action={{routeAction "showCreateAccount"}}+ @label="sign_up"+ class="btn-primary sign-up-button"+ />+ {{/if}}++ <DButton+ @action={{if+ @controller.shouldTriggerRouteAction+ (routeAction "showLogin")+ @controller.showFullPageLogin+ }}+ @icon="user"+ @label="log_in"+ class="btn-primary login-button"+ />+ </div>++ <PluginOutlet+ @name="below-login-buttons"+ @outletArgs={{hash [email protected]}}+ />+ </div>+ </div>+ </section>+ {{/if}}{{/if}}</template>);diff --git a/app/assets/javascripts/discourse/tests/acceptance/login-required-test.js b/app/assets/javascripts/discourse/tests/acceptance/login-required-test.jsindex f78b0f7ead6..85c600e0262 100644--- a/app/assets/javascripts/discourse/tests/acceptance/login-required-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/login-required-test.js@@ -9,8 +9,8 @@ acceptance("Login Required - Full page login", function (needs) {await visit("/");assert.strictEqual(currentRouteName(),- "discovery.login-required",- "it shows the login required splash"+ "login",+ "it redirects them to login");await click(".login-button");diff --git a/app/assets/javascripts/discourse/tests/acceptance/static-test.js b/app/assets/javascripts/discourse/tests/acceptance/static-test.jsindex ab4d1852ac6..c89102f576a 100644--- a/app/assets/javascripts/discourse/tests/acceptance/static-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/static-test.js@@ -43,19 +43,11 @@ acceptance("Static pages", function () {test("Login-required page", async function (assert) {this.siteSettings.login_required = true;- await visit("/");+ await visit("/login");- assert.strictEqual(currentRouteName(), "discovery.login-required");+ assert.strictEqual(currentRouteName(), "login");assert.dom(".body-page").exists("The content is present");assert.dom(".sign-up-button").exists();assert.dom(".login-button").exists();});-- test("Login-required - Login Route", async function (assert) {- this.siteSettings.login_required = true;- await visit("/login");-- assert.strictEqual(currentRouteName(), "login");- assert.dom(".login-fullpage").exists("The login full page form is shown");- });});diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex 9952dae0167..84a6ec562bb 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -753,7 +753,6 @@ class ApplicationController < ActionController::Basecookies[:destination_url] = destination_urlredirect_to path("/auth/#{Discourse.enabled_authenticators.first.name}")else- return if request.path == path("/") && !cookies[:authentication_data]# save original URL in a cookie (javascript redirects after login in this case)cookies[:destination_url] = destination_urlredirect_to path("/login")diff --git a/config/routes.rb b/config/routes.rbindex 7a4d784686f..101b2fc63bc 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -548,7 +548,6 @@ Discourse::Application.routes.draw dopost "login" => "static#enter"get "login" => "static#show", :id => "login"- get "login-required" => "static#show", :id => "login"get "login-preferences" => "static#show", :id => "login"get "signup" => "static#show", :id => "signup"get "password-reset" => "static#show", :id => "password_reset"diff --git a/spec/requests/application_controller_spec.rb b/spec/requests/application_controller_spec.rbindex 4a5c7048b43..230af6201fa 100644--- a/spec/requests/application_controller_spec.rb+++ b/spec/requests/application_controller_spec.rb@@ -14,10 +14,9 @@ RSpec.describe ApplicationController doexpect(response.headers["Cache-Control"]).to eq("no-cache, no-store")end- it "should not redirect to login" do+ it "should redirect to login normally" doget "/"- expect(response).not_to redirect_to("/login")- expect(response.status).to eq(200)+ expect(response).to redirect_to("/login")endit "should redirect to SSO if enabled" do@@ -28,11 +27,10 @@ RSpec.describe ApplicationController doendit "should redirect to authenticator if only one, and local logins disabled" do- # Local logins and google enabled, show login UI+ # Local logins and google enabled, direct to login UISiteSetting.enable_google_oauth2_logins = trueget "/"- expect(response).not_to redirect_to("/login")- expect(response.status).to eq(200)+ expect(response).to redirect_to("/login")# Only google enabled, login immediatelySiteSetting.enable_local_logins = false@@ -42,8 +40,7 @@ RSpec.describe ApplicationController do# Google and GitHub enabled, direct to login UISiteSetting.enable_github_logins = trueget "/"- expect(response).not_to redirect_to("/login")- expect(response.status).to eq(200)+ expect(response).to redirect_to("/login")endit "should not redirect to SSO when auth_immediately is disabled" do@@ -52,8 +49,7 @@ RSpec.describe ApplicationController doSiteSetting.enable_discourse_connect = trueget "/"- expect(response).not_to redirect_to("/login")- expect(response.status).to eq(200)+ expect(response).to redirect_to("/login")endit "should not redirect to authenticator when auth_immediately is disabled" do@@ -62,8 +58,7 @@ RSpec.describe ApplicationController doSiteSetting.enable_local_logins = falseget "/"- expect(response).not_to redirect_to("/login")- expect(response.status).to eq(200)+ expect(response).to redirect_to("/login")endcontext "with omniauth in test mode" dodiff --git a/spec/system/login_spec.rb b/spec/system/login_spec.rbindex 15021fa758b..7ecbdf73629 100644--- a/spec/system/login_spec.rb+++ b/spec/system/login_spec.rb@@ -134,6 +134,7 @@ shared_examples "login scenarios" do |login_page_object|Fabricate(:group_private_message_topic, user: user, recipient_group: group)visit "/t/#{pm.id}"+ find(".login-welcome .login-button").clicklogin_form.fill(username: "john", password: "supersecurepassword").click_loginexpect(page).to have_css(".header-dropdown-toggle.current-user")diff --git a/spec/system/social_authentication_spec.rb b/spec/system/social_authentication_spec.rbindex 80d1cc15e28..2625b3b5f14 100644--- a/spec/system/social_authentication_spec.rb+++ b/spec/system/social_authentication_spec.rb@@ -272,7 +272,8 @@ shared_examples "social authentication scenarios" do |signup_page_object, login_mock_google_authvisit("/login")- expect(page).to have_css(".btn-social")+ expect(page).to have_css(".login-welcome")+ expect(page).to have_css(".site-logo")visit("/")expect(page).to have_css(".login-welcome")