mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FIX: Bring back the login-required page for fullpage login (#29316)
This commit is contained in:
parent
ad39688afa
commit
4254a686d5
@ -35,6 +35,7 @@ export default class LoginPageController extends Controller {
|
||||
@tracked loggingIn = false;
|
||||
@tracked loggedIn = false;
|
||||
@tracked showLoginButtons = true;
|
||||
@tracked showLogin = false;
|
||||
@tracked showSecondFactor = false;
|
||||
@tracked loginPassword = "";
|
||||
@tracked loginName = "";
|
||||
@ -115,6 +116,11 @@ export default class LoginPageController extends Controller {
|
||||
return getURL("/u/admin-login");
|
||||
}
|
||||
|
||||
@action
|
||||
showLoginPage() {
|
||||
this.showLogin = true;
|
||||
}
|
||||
|
||||
@action
|
||||
async passkeyLogin(mediation = "optional") {
|
||||
try {
|
||||
|
@ -21,10 +21,8 @@ export default class LoginRoute extends DiscourseRoute {
|
||||
}
|
||||
|
||||
model() {
|
||||
if (!this.siteSettings.experimental_full_page_login) {
|
||||
return StaticPage.find("login");
|
||||
}
|
||||
}
|
||||
|
||||
setupController(controller) {
|
||||
super.setupController(...arguments);
|
||||
|
@ -1,4 +1,9 @@
|
||||
{{#if this.siteSettings.experimental_full_page_login}}
|
||||
{{#if
|
||||
(and
|
||||
this.siteSettings.experimental_full_page_login
|
||||
(or this.showLogin (not this.siteSettings.login_required))
|
||||
)
|
||||
}}
|
||||
{{hide-application-header-buttons "search" "login" "signup" "menu"}}
|
||||
{{hide-application-sidebar}}
|
||||
|
||||
@ -163,7 +168,11 @@
|
||||
{{/if}}
|
||||
|
||||
<DButton
|
||||
@action={{route-action "showLogin"}}
|
||||
@action={{if
|
||||
this.siteSettings.experimental_full_page_login
|
||||
this.showLoginPage
|
||||
(route-action "showLogin")
|
||||
}}
|
||||
@icon="user"
|
||||
@label="log_in"
|
||||
class="btn-primary login-button"
|
||||
|
@ -115,14 +115,9 @@ shared_examples "login scenarios" do |login_page_object|
|
||||
|
||||
it "cannot browse annonymously" do
|
||||
visit "/"
|
||||
|
||||
if SiteSetting.experimental_full_page_login
|
||||
expect(page).to have_css(".login-fullpage")
|
||||
else
|
||||
expect(page).to have_css(".login-welcome")
|
||||
expect(page).to have_css(".site-logo")
|
||||
find(".login-welcome .login-button").click
|
||||
end
|
||||
|
||||
EmailToken.confirm(Fabricate(:email_token, user: user).token)
|
||||
login_form.fill(username: "john", password: "supersecurepassword").click_login
|
||||
|
Loading…
Reference in New Issue
Block a user