File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ import { useRecoilState, useRecoilValue } from "recoil";
8
8
import BannerMessages from "./components/BannerMessages" ;
9
9
import NavBar from "./components/navbar" ;
10
10
import Sidebar from "./components/sidebar" ;
11
- import { isMobileState , profileFlagsSelector } from "./data/atoms" ;
11
+ import {
12
+ isMobileState ,
13
+ profileFlagsSelector ,
14
+ isLoggedInState ,
15
+ } from "./data/atoms" ;
12
16
13
17
const menuItems = [
14
18
{
@@ -40,6 +44,7 @@ const menuItems = [
40
44
41
45
export default function App ( { children } ) {
42
46
const location = useLocation ( ) ;
47
+ const isLoggedIn = useRecoilValue ( isLoggedInState ) ;
43
48
const [ _ , setCookie ] = useCookies ( [ "irclickid" ] ) ; // eslint-disable-line
44
49
45
50
let allMenuItems = menuItems ;
@@ -120,6 +125,15 @@ export default function App({ children }) {
120
125
} ) ;
121
126
}
122
127
128
+ if (
129
+ ! process . env . REACT_APP_ENABLE_SUBSCRIPTION_MANAGEMENT &&
130
+ ! location . pathname . startsWith ( "/app/" ) &&
131
+ ! isLoggedIn
132
+ ) {
133
+ // Redirect to login page if user is not logged in
134
+ window . location . href = "/login" ;
135
+ }
136
+
123
137
return (
124
138
< div id = "app-container" >
125
139
< SnackbarProvider
You can’t perform that action at this time.
0 commit comments