Updated forgot_password()

If identity is set to username it was showing invalid email address. So the modified code first checks if the identity in ion config file is set to "username" or "emai"l. If it is set to "username" we can't set the validation rule of valid_email.