Skip to content

Commit e2d3325

Browse files
committed
get rid of the old login/landing page
1 parent d60b6a9 commit e2d3325

File tree

2 files changed

+15
-449
lines changed

2 files changed

+15
-449
lines changed

src/packages/frontend/account/account-page.tsx

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ for different account related information
1010
and configuration.
1111
*/
1212

13+
import { useEffect } from "react";
1314
import { Space } from "antd";
1415
import { useIntl } from "react-intl";
15-
1616
import { SignOut } from "@cocalc/frontend/account/sign-out";
1717
import { AntdTabItem, Col, Row, Tabs } from "@cocalc/frontend/antd-bootstrap";
1818
import {
@@ -25,8 +25,6 @@ import { Icon, Loading } from "@cocalc/frontend/components";
2525
import { cloudFilesystemsEnabled } from "@cocalc/frontend/compute";
2626
import CloudFilesystems from "@cocalc/frontend/compute/cloud-filesystem/cloud-filesystems";
2727
import { labels } from "@cocalc/frontend/i18n";
28-
import { LandingPage } from "@cocalc/frontend/landing-page/landing-page";
29-
import { local_storage_length } from "@cocalc/frontend/misc/local-storage";
3028
import PurchasesPage from "@cocalc/frontend/purchases/purchases-page";
3129
import StatementsPage from "@cocalc/frontend/purchases/statements-page";
3230
import SubscriptionsPage from "@cocalc/frontend/purchases/subscriptions-page";
@@ -41,6 +39,7 @@ import { LicensesPage } from "./licenses/licenses-page";
4139
import { PublicPaths } from "./public-paths/public-paths";
4240
import { SSHKeysPage } from "./ssh-keys/global-ssh-keys";
4341
import { UpgradesPage } from "./upgrades/upgrades-page";
42+
import { appBasePath } from "@cocalc/frontend/customize/app-base-path";
4443

4544
export const AccountPage: React.FC = () => {
4645
const intl = useIntl();
@@ -52,44 +51,11 @@ export const AccountPage: React.FC = () => {
5251
const is_logged_in = useTypedRedux("account", "is_logged_in");
5352
const account_id = useTypedRedux("account", "account_id");
5453
const is_anonymous = useTypedRedux("account", "is_anonymous");
55-
const strategies = useTypedRedux("account", "strategies");
56-
const sign_up_error = useTypedRedux("account", "sign_up_error");
57-
const sign_in_error = useTypedRedux("account", "sign_in_error");
58-
const signing_in = useTypedRedux("account", "signing_in");
59-
const signing_up = useTypedRedux("account", "signing_up");
60-
const forgot_password_error = useTypedRedux(
61-
"account",
62-
"forgot_password_error",
63-
);
64-
const forgot_password_success = useTypedRedux(
65-
"account",
66-
"forgot_password_success",
67-
);
68-
const show_forgot_password = useTypedRedux("account", "show_forgot_password");
69-
const token = useTypedRedux("account", "token");
70-
const reset_key = useTypedRedux("account", "reset_key");
71-
const reset_password_error = useTypedRedux("account", "reset_password_error");
72-
const remember_me = useTypedRedux("account", "remember_me");
73-
const has_remember_me = useTypedRedux("account", "has_remember_me");
74-
7554
const kucalc = useTypedRedux("customize", "kucalc");
7655
const ssh_gateway = useTypedRedux("customize", "ssh_gateway");
7756
const is_commercial = useTypedRedux("customize", "is_commercial");
7857
const get_api_key = useTypedRedux("page", "get_api_key");
7958

80-
// for each exclusive domain, tell the user which strategy to use
81-
const exclusive_sso_domains = React.useMemo(() => {
82-
if (strategies == null) return;
83-
const domains: { [domain: string]: string } = {};
84-
for (const strat of strategies) {
85-
const doms = strat.get("exclusive_domains");
86-
for (const dom of doms ?? []) {
87-
domains[dom] = strat.get("name");
88-
}
89-
}
90-
return domains;
91-
}, [strategies]);
92-
9359
function handle_select(key: string): void {
9460
switch (key) {
9561
case "billing":
@@ -104,28 +70,6 @@ export const AccountPage: React.FC = () => {
10470
redux.getActions("account").push_state(`/${key}`);
10571
}
10672

107-
function render_landing_page(): JSX.Element {
108-
return (
109-
<LandingPage
110-
strategies={strategies}
111-
exclusive_sso_domains={exclusive_sso_domains}
112-
sign_up_error={sign_up_error}
113-
sign_in_error={sign_in_error}
114-
signing_in={signing_in}
115-
signing_up={signing_up}
116-
forgot_password_error={forgot_password_error}
117-
forgot_password_success={forgot_password_success}
118-
show_forgot_password={show_forgot_password}
119-
token={token}
120-
reset_key={reset_key}
121-
reset_password_error={reset_password_error}
122-
remember_me={remember_me}
123-
has_remember_me={has_remember_me}
124-
has_account={local_storage_length() > 0}
125-
/>
126-
);
127-
}
128-
12973
function render_account_tab(): AntdTabItem {
13074
return {
13175
key: "account",
@@ -303,9 +247,19 @@ export const AccountPage: React.FC = () => {
303247
className="smc-vfill"
304248
style={{ overflow: "auto", paddingLeft: "5%", paddingRight: "5%" }}
305249
>
306-
{is_logged_in && !get_api_key
307-
? render_logged_in_view()
308-
: render_landing_page()}
250+
{is_logged_in && !get_api_key ? (
251+
render_logged_in_view()
252+
) : (
253+
<RedirectToNextApp />
254+
)}
309255
</div>
310256
);
311257
};
258+
259+
function RedirectToNextApp({}) {
260+
useEffect(() => {
261+
window.location.href = appBasePath;
262+
}, []);
263+
264+
return null;
265+
}

0 commit comments

Comments
 (0)