redirect unauthenticated users to login page

This commit is contained in:
2019-03-06 22:37:07 +03:00
parent 34c7b6f1cb
commit 83382d3db1
2 changed files with 17 additions and 5 deletions

View File

@@ -3459,7 +3459,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@@ -3874,7 +3875,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -3930,6 +3932,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -3973,12 +3976,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

View File

@@ -1,6 +1,12 @@
import * as React from "react";
import { connect } from "react-redux";
import { Route, RouteComponentProps, Switch, withRouter } from "react-router";
import {
Redirect,
Route,
RouteComponentProps,
Switch,
withRouter,
} from "react-router";
import { AuthScreen } from "~Auth/AuthScreen";
import { Home } from "~Home/Home";
import { Landing } from "~Landing/Landing";
@@ -25,6 +31,7 @@ export function AppComponent(props: IAppComponentProps) {
<Route path="/signup" component={AuthScreen} />
<Route path="/login" component={AuthScreen} />
<Route exact={true} path="/" component={Landing} />
<Route path="/" component={() => <Redirect to="/login" />} />
</Switch>
);
}