api-login change creds

This commit is contained in:
2023-12-15 19:30:25 +03:00
parent 932ea915de
commit ecd32b6529
2 changed files with 16 additions and 5 deletions

View File

@ -120,6 +120,17 @@ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface
return static::findOne(['username' => $username, 'status' => self::STATUS_ACTIVE]);
}
/**
* Finds user by email
*
* @param string $email
* @return static|null
*/
public static function findByEmail($email)
{
return static::findOne(['username' => $email, 'status' => self::STATUS_ACTIVE]);
}
/**
* Finds user by password reset token
*