Skip to content

auth0-react doesn't play well with useNavigate and useBlocker #965

@gonzalob

Description

@gonzalob

Checklist

Description

When wrapping a component with withAuthenticationRequired, having useNavigate in the same component, blockers don't activate.

We can provide a minimal sample project: https://github.com/blockademy/auth0-react-and-usenavigate

Reproduction

Use withAuthenticationRequired and useNavigate at the same time (as in https://github.com/blockademy/auth0-react-and-usenavigate/blob/main/src/AuthGuard.tsx)

Then configure a react Blocker anywhere.

Additional context

No response

auth0-react version

2.8.0

React version

19.2.0

Which browsers have you tested in?

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions