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('', {access_token: accesstoken})
        .then((res) => {
          axios.get(ApiUrlConstant.getApiFullUrl("auth.lastlogin"), {
              headers: {
                Authorization: "Token " +,
            .then((response) => {
    [0] &&[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 (
          clientId="PROJECT CLIENT ID"
          buttonText="LOGIN WITH GOOGLE"

export default LoginGoogle; 

Source: React Router Questions