Fix authentication bug when token is empty