Feature/Redirection #114
4 changed files with 22 additions and 3 deletions
|
@ -12,6 +12,9 @@ import Manual from "./components/pages/Manual";
|
||||||
import Secret from "./components/pages/Secret";
|
import Secret from "./components/pages/Secret";
|
||||||
import Umfrage from "./components/pages/Umfrage";
|
import Umfrage from "./components/pages/Umfrage";
|
||||||
import PrivateRoute from "./auth/PrivateRoute";
|
import PrivateRoute from "./auth/PrivateRoute";
|
||||||
|
import Behavior from "./components/pages/Behavior";
|
||||||
|
import { Logger } from "@behametrics/logger-web";
|
||||||
|
import { useAuth } from "./auth/AuthProvider";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
|
@ -27,6 +30,7 @@ function App() {
|
||||||
<Route path="/register" component={Register} />
|
<Route path="/register" component={Register} />
|
||||||
<Route path="/manual" component={Manual} />
|
<Route path="/manual" component={Manual} />
|
||||||
<Route path="/ueber" component={Ueber} />
|
<Route path="/ueber" component={Ueber} />
|
||||||
|
<PrivateRoute path="/behavior" component={Behavior} />
|
||||||
<PrivateRoute path="/secret" component={Secret} />
|
<PrivateRoute path="/secret" component={Secret} />
|
||||||
<PrivateRoute path="/umfrage" component={Umfrage} />
|
<PrivateRoute path="/umfrage" component={Umfrage} />
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
14
frontend/src/components/pages/Behavior.js
Normal file
14
frontend/src/components/pages/Behavior.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import React from "react";
|
||||||
|
import "../../App.css";
|
||||||
|
import Footer from "../../Footer";
|
||||||
|
|
||||||
|
export default function Behavior() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="sitePage">
|
||||||
|
<h1>Studie Verhaltensmerkmale</h1>
|
||||||
|
</div>
|
||||||
|
<Footer />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ import "../../App.css";
|
||||||
import Footer from "../../Footer";
|
import Footer from "../../Footer";
|
||||||
import InputField from "../InputField";
|
import InputField from "../InputField";
|
||||||
import SubmitField from "../SubmitField";
|
import SubmitField from "../SubmitField";
|
||||||
|
import { Redirect } from "react-router";
|
||||||
import { login, useAuth, logout } from "../../auth/AuthProvider";
|
import { login, useAuth, logout } from "../../auth/AuthProvider";
|
||||||
import Secret from "./Secret";
|
import Secret from "./Secret";
|
||||||
import ErrorMessage from "../ErrorMessage";
|
import ErrorMessage from "../ErrorMessage";
|
||||||
|
@ -71,8 +72,7 @@ export default function Login() {
|
||||||
</form>
|
</form>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Secret />
|
<Redirect to="/behavior" />
|
||||||
<button onClick={() => logout()}>Logout</button>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import SubmitField from "../SubmitField";
|
||||||
import { authFetch } from "../../auth/AuthProvider";
|
import { authFetch } from "../../auth/AuthProvider";
|
||||||
import ErrorMessage from "../ErrorMessage";
|
import ErrorMessage from "../ErrorMessage";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { Redirect } from "react-router";
|
||||||
|
|
||||||
export default function Umfrage() {
|
export default function Umfrage() {
|
||||||
/* values from survey */
|
/* values from survey */
|
||||||
|
@ -218,7 +219,7 @@ export default function Umfrage() {
|
||||||
{!isSurveyValidBackend ? (
|
{!isSurveyValidBackend ? (
|
||||||
<ErrorMessage message={backendErrorMessage} />
|
<ErrorMessage message={backendErrorMessage} />
|
||||||
) : (
|
) : (
|
||||||
<p>{backendSuccessMessage}</p>
|
<Redirect to="/behavior" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|
Loading…
Reference in a new issue