@@ -10,9 +10,9 @@ for different account related information
10
10
and configuration.
11
11
*/
12
12
13
+ import { useEffect } from "react" ;
13
14
import { Space } from "antd" ;
14
15
import { useIntl } from "react-intl" ;
15
-
16
16
import { SignOut } from "@cocalc/frontend/account/sign-out" ;
17
17
import { AntdTabItem , Col , Row , Tabs } from "@cocalc/frontend/antd-bootstrap" ;
18
18
import {
@@ -25,8 +25,6 @@ import { Icon, Loading } from "@cocalc/frontend/components";
25
25
import { cloudFilesystemsEnabled } from "@cocalc/frontend/compute" ;
26
26
import CloudFilesystems from "@cocalc/frontend/compute/cloud-filesystem/cloud-filesystems" ;
27
27
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" ;
30
28
import PurchasesPage from "@cocalc/frontend/purchases/purchases-page" ;
31
29
import StatementsPage from "@cocalc/frontend/purchases/statements-page" ;
32
30
import SubscriptionsPage from "@cocalc/frontend/purchases/subscriptions-page" ;
@@ -41,6 +39,7 @@ import { LicensesPage } from "./licenses/licenses-page";
41
39
import { PublicPaths } from "./public-paths/public-paths" ;
42
40
import { SSHKeysPage } from "./ssh-keys/global-ssh-keys" ;
43
41
import { UpgradesPage } from "./upgrades/upgrades-page" ;
42
+ import { appBasePath } from "@cocalc/frontend/customize/app-base-path" ;
44
43
45
44
export const AccountPage : React . FC = ( ) => {
46
45
const intl = useIntl ( ) ;
@@ -52,44 +51,11 @@ export const AccountPage: React.FC = () => {
52
51
const is_logged_in = useTypedRedux ( "account" , "is_logged_in" ) ;
53
52
const account_id = useTypedRedux ( "account" , "account_id" ) ;
54
53
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
-
75
54
const kucalc = useTypedRedux ( "customize" , "kucalc" ) ;
76
55
const ssh_gateway = useTypedRedux ( "customize" , "ssh_gateway" ) ;
77
56
const is_commercial = useTypedRedux ( "customize" , "is_commercial" ) ;
78
57
const get_api_key = useTypedRedux ( "page" , "get_api_key" ) ;
79
58
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
-
93
59
function handle_select ( key : string ) : void {
94
60
switch ( key ) {
95
61
case "billing" :
@@ -104,28 +70,6 @@ export const AccountPage: React.FC = () => {
104
70
redux . getActions ( "account" ) . push_state ( `/${ key } ` ) ;
105
71
}
106
72
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
-
129
73
function render_account_tab ( ) : AntdTabItem {
130
74
return {
131
75
key : "account" ,
@@ -303,9 +247,19 @@ export const AccountPage: React.FC = () => {
303
247
className = "smc-vfill"
304
248
style = { { overflow : "auto" , paddingLeft : "5%" , paddingRight : "5%" } }
305
249
>
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
+ ) }
309
255
</ div >
310
256
) ;
311
257
} ;
258
+
259
+ function RedirectToNextApp ( { } ) {
260
+ useEffect ( ( ) => {
261
+ window . location . href = appBasePath ;
262
+ } , [ ] ) ;
263
+
264
+ return null ;
265
+ }
0 commit comments