From the code snippet you posted of the authenticate user server behavior, I see you are using password encryption.
Is the registration page storing the encrypted password as well?
An SHA1 encrypted string is 40 characters long, the Password database column needs to be set to except 40 characters or the string will be truncated. Double check that the password column is set as varchar(40)