ae7d63db35
Did the following: - Extract front-end from component; - Added localStorage for remembering API details and access key; - Added routing to login component; Todo: - Remove getApi*FromDTO; - Create ProtectedRoute to prevent unauthorized entry to /dashboard;
22 lines
509 B
TypeScript
22 lines
509 B
TypeScript
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
|
|
import React from 'react';
|
|
import { Switch, Route, Redirect } from 'react-router-dom';
|
|
import Login from '../LoginComponent/Login';
|
|
import Dashboard from '../DashboardComponent/Dashboard';
|
|
|
|
export default class App extends React.Component {
|
|
|
|
render() {
|
|
return (
|
|
<Switch>
|
|
<Route exact path="/"
|
|
component={Login} />
|
|
<Route path="/dashboard"
|
|
component={Dashboard} />
|
|
<Redirect to="/" />
|
|
</Switch>
|
|
);
|
|
}
|
|
}
|