Easy Authentication with AUTH0

Client Side Sessions


JWT authentication is stateless by nature and this means that handling user sessions is a bit different than traditional methods of authentication. On the client side we can use the expiry time of the access token to give us a 'hint' that the user is authenticated. Really, that determination comes down to whether or not the access token is valid, but that's a check that can only be made on the backend. Let's use the expiry time for the access token to conditionally hide and show various UI elements. Let's also put in a method to remove the tokens from local storage so that the user can be considered logged out.