From 6e7a2637d866ecce1fe364cafbad92723800517d Mon Sep 17 00:00:00 2001 From: Leon Xu Date: Sat, 7 May 2022 12:57:33 -0700 Subject: [PATCH] doc: add loginwithEmailandPassword, then redirect the user back to homepage --- src/Auth/Login.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Auth/Login.js b/src/Auth/Login.js index b1f4344..6c7008a 100644 --- a/src/Auth/Login.js +++ b/src/Auth/Login.js @@ -10,6 +10,12 @@ function Login() { const signIn = (e) => { e.preventDefault(); + auth + .signInWithEmailAndPassword(email, password) + .then((auth) => { + history.push("/"); + }) + .catch((error) => alert(error.message)); }; const register = (e) => {