FIX: Clicking on login should show login modal (#177)

* FIX: Clicking on login should show login modal

* Add system test that shows the login modal appears
This commit is contained in:
Natalie Tay
2023-09-28 14:21:16 +08:00
committed by GitHub
parent b855ce9bb9
commit c30fea21ef
3 changed files with 18 additions and 19 deletions
@@ -1,17 +0,0 @@
import Component from "@ember/component";
import cookie from "discourse/lib/cookie";
import DiscourseURL from "discourse/lib/url";
import { default as getURL } from "discourse-common/lib/get-url";
export default Component.extend({
classNames: ["login-required", "subscriptions"],
actions: {
createAccount() {
const destinationUrl = window.location.href;
const cookiePath = getURL("/");
cookie("destination_url", destinationUrl, { path: cookiePath });
DiscourseURL.redirectTo("/login");
},
},
});
@@ -2,7 +2,7 @@
<DButton
@label="log_in"
@action={{this.createAccount}}
@action={{route-action "showLogin"}}
@icon="user"
class="btn btn-primary"
class="btn btn-primary login-required subscriptions"
/>