Fix bug in auth