User Signup

Hi to all,

I’m trying to customize the signup to my site beginning from the user class in deuterium folder.

All works fine if I don’t use the auth_key to encrypt the password. I use

$this->auth_key = Yii::$app->security->generateRandomKey(); 

but when I call the save method of my user class I get this error:

The auth_key field in database is a varchar(255) with utf8_general_ci as collation.

Could you help me to understand what’s wrong in my user class?

Thank you!!


this may be because u r not using namespace for security class, so u have to confirm following namespace:

use yii\helpers\Security;

generateRandomKey → generateRandomString

Thank you very much! Using generateRandomString works perfectly!