Adjusted formatting
This commit is contained in:
parent
c57492f826
commit
b22dd6f5e8
11 changed files with 29 additions and 37 deletions
|
@ -1,11 +1,10 @@
|
||||||
import { createAuthProvider } from "react-token-auth";
|
import { createAuthProvider } from "react-token-auth";
|
||||||
|
|
||||||
export const [useAuth, authFetch, login, logout] =
|
export const [useAuth, authFetch, login, logout] = createAuthProvider({
|
||||||
createAuthProvider({
|
accessTokenKey: "access_token",
|
||||||
accessTokenKey: 'access_token',
|
onUpdateToken: (token) =>
|
||||||
onUpdateToken: (token) => fetch('/api/refresh', {
|
fetch("/api/refresh", {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
body: token.access_token
|
body: token.access_token,
|
||||||
})
|
}).then((r) => r.json()),
|
||||||
.then(r => r.json())
|
});
|
||||||
})
|
|
||||||
|
|
|
@ -14,4 +14,4 @@ const PrivateRoute = ({ component: Component, ...rest }) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PrivateRoute
|
export default PrivateRoute;
|
||||||
|
|
|
@ -2,7 +2,6 @@ import React from "react";
|
||||||
import "./Button.css";
|
import "./Button.css";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
|
||||||
const STYLES = ["btn--primary", "btn--outline"];
|
const STYLES = ["btn--primary", "btn--outline"];
|
||||||
|
|
||||||
const SIZES = ["btn--medium", "btn--large"];
|
const SIZES = ["btn--medium", "btn--large"];
|
||||||
|
|
|
@ -5,7 +5,12 @@ function InputField(props) {
|
||||||
return (
|
return (
|
||||||
<label className="input-field">
|
<label className="input-field">
|
||||||
<p>{props.LabelName}</p>
|
<p>{props.LabelName}</p>
|
||||||
<input name={props.InputName} onChange={props.onChange} type={props.InputType} placeholder={props.InputPlaceHolder}/>
|
<input
|
||||||
|
name={props.InputName}
|
||||||
|
onChange={props.onChange}
|
||||||
|
type={props.InputType}
|
||||||
|
placeholder={props.InputPlaceHolder}
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import "./Input.css"
|
import "./Input.css";
|
||||||
import "./Button.css"
|
import "./Button.css";
|
||||||
|
|
||||||
function SubmitField(props) {
|
function SubmitField(props) {
|
||||||
const InputValue = props.LabelName;
|
const InputValue = props.LabelName;
|
||||||
|
|
|
@ -6,8 +6,8 @@ import InputField from "../InputField";
|
||||||
import SubmitField from "../SubmitField";
|
import SubmitField from "../SubmitField";
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
const [username, setUsername] = useState('')
|
const [username, setUsername] = useState("");
|
||||||
const [password, setPassword] = useState('')
|
const [password, setPassword] = useState("");
|
||||||
|
|
||||||
const onSubmitClick = (e) => {
|
const onSubmitClick = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -19,7 +19,7 @@ export default function Login() {
|
||||||
fetch("/api/register", {
|
fetch("/api/register", {
|
||||||
method: "post",
|
method: "post",
|
||||||
body: JSON.stringify(opts),
|
body: JSON.stringify(opts),
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUsernameChange = (e) => {
|
const handleUsernameChange = (e) => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { useEffect, useState } from "react/cjs/react.development";
|
import { useEffect, useState } from "react/cjs/react.development";
|
||||||
import {authFetch} from "../../auth/AuthProvider.js"
|
import { authFetch } from "../../auth/AuthProvider.js";
|
||||||
|
|
||||||
function Secret() {
|
function Secret() {
|
||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
import React from "react";
|
|
||||||
import "../../App.css";
|
|
||||||
import Footer from "../../Footer";
|
|
||||||
|
|
||||||
export default function SignUp() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<h1 className="sign-up">SIGN UP</h1>
|
|
||||||
<Footer />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -8,7 +8,8 @@ export default function Ueber() {
|
||||||
<div className="sitePage">
|
<div className="sitePage">
|
||||||
<h1>Über das Projekt</h1>
|
<h1>Über das Projekt</h1>
|
||||||
<p>
|
<p>
|
||||||
Im Rahmen meiner Bachelorthesis an der Fernfachhochschule Schweiz möchte ich der Frage nachgehen, wie sich die Verhaltensmerkmale in unterschiedlichen Situationen unterscheiden. Hierfür habe ich eine Webanwendung entwickelt, welche die Nutzerinnen und Nutzer möglichst einfach durch die Studie führt.
|
Im Rahmen meiner Bachelorthesis an der Fernfachhochschule Schweiz möchte ich der Frage nachgehen, wie sich die Verhaltensmerkmale in unterschiedlichen Situationen unterscheiden. Hierfür habe ich eine Webanwendung entwickelt, welche die Nutzerinnen und Nutzer möglichst
|
||||||
|
einfach durch die Studie führt.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Falls Sie Fragen haben, können Sie diese jederzeit per Mail stellen. Gerne kann ich auch meine Disposition zur Verfügung stellen.
|
Falls Sie Fragen haben, können Sie diese jederzeit per Mail stellen. Gerne kann ich auch meine Disposition zur Verfügung stellen.
|
||||||
|
|
Loading…
Reference in a new issue