Is the authorize step supposed to take longer than a second?

I am working through the excellent React SPA tutorial provided by the Auth0 blog.

Youtube tutorial: React and AUht0 Crash Course
Auth0 React Workshop

Everything works. But the performance seems pretty bad.

When you first visit the app or when you refresh the page with F5, useAuth0() makes a call to /authorize.
For 5 intermittent refreshes it took (1.68 s, 2.52 s, 2.49 s, 2.76 s, 2.18 s). That’s an average of 2.3 seconds to get a response from the /authorize endpoint.
For 5 “spamming” F5s, it took (2 s, 552 ms, 667 ms, 1.81 s, 418 ms)
So maybe there’s some caching going on at the Auth0 server. :man_shrugging: Regardless, it’s still pretty slow.

The tutorial shows a gigantic circular progressbar rotating for a good 2+ seconds which is not a great UI experience. To be fair, there are no calls to /authorize using normal SPA-ish navigation with Browser Router Links or history.push() so normal navigation isn’t affected.

Is this normal for everyone? Does this only happen to free tier because we are on some kind of shared box?

Thanks for any help in advance.

Cheers.

Hi @strongmove,

Welcome to the Auth0 Community!

I am not seeing anything like that on my end. Here is a spread of ten requests to /authorize:

This is in a new browser session in Chrome.

Is your application stalling on the request? Or is it the application that is causing the latency?

1 Like