How to write the code to show the message and then redirect to the login page

I am a new in this field and I want to solve this for my first project. I just want to show the warning message that this email is already exit in our database then after 2-3 seconds it will automatically redirect to the login page with auto filled the email field of user so the user easily can enter his password and logged in his account. (onfailure command in code).
Below can see my code…

class LoginGoogle extends Component {
  render() {
    const LoginGoogle = async (accesstoken) => {
      let res = await axios
        .post('http://127.0.0.1:8000/user/google/', {access_token: accesstoken})
        .then((res) => {
          loginu(res.data.key);
          axios.get(ApiUrlConstant.getApiFullUrl("auth.lastlogin"), {
              headers: {
                Authorization: "Token " + res.data.key,
              },
            })
            .then((response) => {
              response.data[0] && response.data[0]["first_login"]
                ? this.props.history.push("/edityourprofile")
                : this.props.history.push("/dashboard");
            })
            .catch((error) => console.log(error.reponse));
        });
    };

    const responseGoogle = async (response) => {
      let googleResponse = await LoginGoogle(response.accessToken);
    };
    return (
      <div>
        <GoogleLogin
          clientId="PROJECT CLIENT ID"
          buttonText="LOGIN WITH GOOGLE"
          onSuccess={responseGoogle}
          onFailure={FaildGoogle}  
        />
      </div>
    );
  }
}

export default LoginGoogle; 

Source: React Router Questions