Hi guys.
So I enroll my users like this in my server
console.log("user doesn't exist create one")
var userId = Accounts.createUser({email})
console.log('userId', userId)
Accounts.sendEnrollmentEmail(userId)
This works fine.
Then on the client I redirect to the reset password form with the token
Accounts.onEnrollmentLink(function (token) {
browserHistory.push(`/reset-password/${token}`)
})
on form submit I do this
submitNewPassword = () => {
console.warn('submitNewPassword')
console.log('this.state.changedPasswordValue', this.state.changedPasswordValue)
const { resetToken } = this.props.params
const password = this.state.changedPasswordValue
const self = this
console.log('resetToken', resetToken)
Accounts.resetPassword(resetToken, password, function (err) {
console.log('resetPassword')
if (err) {
console.error('resetPassword error', err)
self.setState({errorMessage: err.reason, error: true})
} else {
self.setState({reset: true, errorMessage: 'Your password changed', error: true})
}
})
}
Now this works perfect with reset password tokens. However in this case if I came from an enrollment email I get error - 403 Invalid Email
Any idea how to fix this?
This code was working perfectly this problem happened only recently. Maybe it is some internal package bug in some specific version?