Hi xeibra,
Thanks for giving more inputs, i tried from my end there are couple of things i can suggest,
- Make sure your using @auth0/auth0-react package.
- Check once you have configured the URL’s
- Please try using the below code once
import { useAuth0 } from "@auth0/auth0-react";
import "./App.css";
const LoginButton = () => {
const { isAuthenticated, loginWithRedirect } = useAuth0();
useEffect(() => {
const checkAuthentication = async () => {
if (isAuthenticated) {
console.log("After Login - isAuthenticated:", isAuthenticated);
}
};
checkAuthentication();
}, [isAuthenticated]);
const handleLogin = () => {
// Log isAuthenticated before login
console.log("Before Login - isAuthenticated:", isAuthenticated);
loginWithRedirect();
};
return (
<div className="container">
{!isAuthenticated && (
<button
onClick={handleLogin}
className="login-button"
>
Log In
</button>
)}
</div>
);
};
export default LoginButton;
for the above code post login, isAuthenticated showing as true in console.
Regards,
Pavan.