bug for register and then auto-login fixed, and his test