Bug fix in SQL for auth token