Avoid api error 500 when auth token is not in the localStorage