fixed issue with email auth and also sql to prevent multiple tokens per user