validate login page

This commit is contained in:
soyed 2021-04-08 19:38:07 -04:00
parent 018b769ca1
commit 37e8157829

View file

@ -1,7 +1,7 @@
import React, { Component } from "react"; import React, { Component } from "react";
import Logo from "../images/logo1.png"; import Logo from "../images/logo1.png";
import "./Login.css"; import "./Login.css";
import { Link } from "react-router-dom"; import { Link, Redirect, withRouter } from "react-router-dom";
// import { useTranslation } from "react-i18next"; // import { useTranslation } from "react-i18next";
import { withTranslation } from "react-i18next"; import { withTranslation } from "react-i18next";
class Login extends Component { class Login extends Component {
@ -15,13 +15,15 @@ class Login extends Component {
}; };
handleLogin = (e) => { handleLogin = (e) => {
// e.preventDefault(); e.preventDefault();
// if ( !== this.state.Account.email) { var loginEmail = document.getElementById("login-email");
// alert("invalid"); if (loginEmail.value === this.state.Account.email) {
// } // alert("validated!!!");
// if (password !== this.state.Account.password) { return this.props.history.push("/account");
// alert("invalid"); } else {
// } // alert("Errors!!")
return this.props.history.push("/login");
}
}; };
render() { render() {
@ -80,4 +82,4 @@ class Login extends Component {
} }
} }
export default withTranslation()(Login); export default withTranslation()(withRouter(Login));