Compare commits

..

No commits in common. '94380c1ea5de0bd557c514e78795ed33404d9f01' and 'b71c9b3f121eb5f60bdfaf8039a8880c2f7dc5d7' have entirely different histories.

  1. 24
      Frontend/src/components/Login.js

24
Frontend/src/components/Login.js

@ -32,23 +32,15 @@ class Login extends Component {
// 123Abc!& // 123Abc!&
login() { login() {
if (this.state.username !== "" && this.state.password !== "") { fetch("/login", { method: "POST", body: JSON.stringify(this.state) })
var formData = new URLSearchParams(); .then(function(response) {
formData.append("username", this.state.username); if (response.status === 200) return response.json();
formData.append("password", this.state.password); else return response.statusText;
fetch("https://local.tobi.one/eva/login", { })
method: "POST", .then(function(myJson) {
body: formData, console.log(myJson);
headers: { //document.cookie = myJson;
"content-type": "application/x-www-form-urlencoded;charset=UTF-8"
}
}).then(response => {
if (response.status === 200) {
console.log("Logged in!");
this.props.history.push("/");
} else console.log(response.statusText);
}); });
}
} }
render() { render() {

Loading…
Cancel
Save