useAuth0 hook - how to interpret error when isAuthenticated is false?

Please include the following information in your post:

  • Which SDK this is regarding: Auth0 React
  • SDK Version: 1.2.0
  • Platform Version: Don’t know
  • Code Snippets/Error Messages/Supporting Details/Screenshots:

Is this a feature request or bug report? No

It’s a question about the “error” value returned by the useAuth0 hook.

The way I understand this is when isLoading is true, the authentication sequence is in progress. But when it is false, I can safely use isAuthenticated.

So,

if isAuthenticated is true, then the user has successfully logged in.

What if isAuthenticated is false? Is this considered an error condition with the reason mentioned in the “error” value returned by the hook?

Or is it possible that isAuthenticated is false but the “error” value gives no reason?

Unfortunately, the documentation for this hook is not awesome, hence the question.

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!