mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
Fixes #4131: Security adjustments
This commit is contained in:
@ -159,7 +159,7 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
*/
|
||||
public function generateAuthKey()
|
||||
{
|
||||
$this->auth_key = Yii::$app->security->generateRandomKey();
|
||||
$this->auth_key = Yii::$app->security->generateRandomString();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -167,7 +167,7 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
*/
|
||||
public function generatePasswordResetToken()
|
||||
{
|
||||
$this->password_reset_token = Yii::$app->security->generateRandomKey() . '_' . time();
|
||||
$this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
return [
|
||||
'username' => 'userName',
|
||||
'auth_key' => function ($fixture, $faker, $index) {
|
||||
$fixture['auth_key'] = Yii::$app->getSecurity()->generateRandomKey();
|
||||
$fixture['auth_key'] = Yii::$app->getSecurity()->generateRandomString();
|
||||
|
||||
return $fixture;
|
||||
},
|
||||
@ -13,7 +13,7 @@ return [
|
||||
return $fixture;
|
||||
},
|
||||
'password_reset_token' => function ($fixture, $faker, $index) {
|
||||
$fixture['password_reset_token'] = Yii::$app->getSecurity()->generateRandomKey() . '_' . time();
|
||||
$fixture['password_reset_token'] = Yii::$app->getSecurity()->generateRandomString() . '_' . time();
|
||||
|
||||
return $fixture;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user