Hi everyone,
I am wondering how to go to login page with pressing a button.
In the example code that is always provided, to go to the login page, I need to create a button and trigger it from there.
import React from “react”;
import { useAuth0 } from “@auth0/auth0-react”;
const LoginButton = () => {
const { loginWithRedirect } = useAuth0();
return <button onClick={() => loginWithRedirect()}>Log In;
};
export default LoginButton;
Instead of doing it on button press, is it possible to go to login page when the website is loaded first time and no one else is currently login?
Thank you in advance.