Auth0 Home Blog Docs

The first time login always fail


#1

I am new for Auth0 and I built a SPA website with .net core, Angular 2. I followed the documents using Auth0 for authentication and it works great. But I find when I login, sometimes I need login twice to get it work.
Here is the isAuthenticated() method in my authentication service:
image
I noticed when it fails login, the Date().getTime() > expiresAt:
image

Can anyone help me with that? Why this happened and how to fix that. Thanks


#2

Looks like this might be caused due to your system clock being out of date.

What’s the current value of the JWT Expiration of your application in the Auth0 dashboard?
Do you continue getting the error if you increase the value?
Is your system clock using network sync against a time server?


#4

Thanks a lot for reply. I doubled the JWT Expiration, but it still need to login twice at the first time.
And here is my system Date & time setting:


I don’t know if there is anything wrong. Thank you.