Problems with user authentication after registration

good morning. I have a problem with my user registry I am using an action

exports.onExecutePostLogin = async (event, api) => {

  if(event.stats.logins_count <= 1){

exports.onContinuePostLogin = async (event, api) => {

my code for the state.
I’m just passing the part of the state. that is not all

  const searchParams = new URLSearchParams(
  const state = searchParams.get('state')
  const [ continueUrl ] = useState(`${state}`)

window.location.href = continueUrl;

The problem is that my user once is already registered. In your first login (the one that comes by default after registering) you cannot perform any action as an authenticated user. In order to perform these actions I must log out and log in again.

When using useAuth0 {isAuthenticated} it seems that if I am authenticated. The problem is when I want to perform one of my fetchs to retrieve the information. that is where the problem arises of having to log out and perform a new login

export default function ListaAlumnos() {
  const { getAccessTokenSilently } = useAuth0();
  const [alumnos, setAlumnos] = useState([]); 

  useEffect(() => {
    const fetchAlumnos = async () => {
      try {
        const token = await getAccessTokenSilently({
          audience: "localhost:8080/seguridad",
        console.log("token " + token);

        const response = await fetch("http://localhost:8080/alumno", {
          headers: {
            Authorization: `Bearer ${token}`,
        const data = await response.json();
      } catch (error) {

  }, [getAccessTokenSilently]);

  return (
      <h1>Aquí estará la lista de alumnos</h1>
      { => (
        <div key={}>{alumno.nombre}</div>

this is my function, when I enter here with my first login, I get the error alert

the problem is getAccessTokenSilently. in my console it appears: Eor: External interaction required