Redirect to Login when not logged in. (#44)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import React from "react";
|
||||
import { Route, Router, Switch } from "react-router-dom";
|
||||
import { Redirect, Route, Router, Switch } from "react-router-dom";
|
||||
import history from "./history";
|
||||
import Login from "./screens/LoginPage";
|
||||
import Console from "./screens/Console/Console";
|
||||
@@ -64,7 +64,7 @@ class Routes extends React.Component<RoutesProps> {
|
||||
) : (
|
||||
<Switch>
|
||||
<Route exact path="/" component={Login} />
|
||||
<Route component={NotFoundPage} />
|
||||
<Redirect to="/" />
|
||||
</Switch>
|
||||
)}
|
||||
</Switch>
|
||||
|
||||
@@ -97,7 +97,7 @@ class AddEvent extends React.Component<IAddEventProps, IAddEventState> {
|
||||
arn: arn,
|
||||
events: selectedEvents,
|
||||
prefix: prefix,
|
||||
sufix: suffix
|
||||
suffix: suffix
|
||||
},
|
||||
ignoreExisting: true
|
||||
})
|
||||
|
||||
@@ -143,7 +143,7 @@ class AddPolicy extends React.Component<IAddPolicyProps, IAddPolicyState> {
|
||||
)}
|
||||
<Grid item xs={12}>
|
||||
<TextField
|
||||
defaultValue={policyEdit ? policyEdit.name : "" }
|
||||
defaultValue={policyEdit ? policyEdit.name : ""}
|
||||
id="standard-basic"
|
||||
fullWidth
|
||||
label="Policy Name"
|
||||
@@ -158,7 +158,11 @@ class AddPolicy extends React.Component<IAddPolicyProps, IAddPolicyState> {
|
||||
<Grid item xs={12}>
|
||||
<CodeMirror
|
||||
className={classes.codeMirror}
|
||||
value={policyEdit ? JSON.stringify(JSON.parse(policyEdit.policy), null, 4) : ""}
|
||||
value={
|
||||
policyEdit
|
||||
? JSON.stringify(JSON.parse(policyEdit.policy), null, 4)
|
||||
: ""
|
||||
}
|
||||
options={{
|
||||
mode: "javascript",
|
||||
lineNumbers: true
|
||||
|
||||
Reference in New Issue
Block a user