Yii2 Exception in ValidatePassword()
问题 I use yii2 for developing web site. Before save user to db, I encripted password like this: $this->password = Yii::$app->security->generatePasswordHash($this->password); And when I use this code: Yii::$app->security->validatePassword("some string", $this->password); I have error: Invalid Parameter – yii\base\InvalidParamException Hash is invalid. What is wrong? 回答1: I ran into the same issue. I realized that my password field's character capacity was too short for the hash, so I bumped it up