common/models/Users.php
/**
     * Finds user by password reset token
     *
     * @param string $token password reset token
     * @param bool $checkTokenValid
     * @return Users|null
     */
Finds user by password reset token
@param string $token password reset token
@param bool $checkTokenValid
@return Users|null
Finds user by password reset token @param string $token password reset token @param bool $checkTokenValid @return Users|null
public static function findByPasswordResetToken($token, $checkTokenValid=true)
    {
        if ($checkTokenValid && !self::isPasswordResetTokenValid($token)) {
            return null;
        }
        return self::getDb()->cache(
            function($db) use($token) {
                return static::findOne(['password_reset_token' => $token, 'user_status' => [self::STATUS_ACTIVE, self::STATUS_CONFIRMED]]);
            },
            self::$CACHE_TTL,
            new TagDependency(['tags' => 'Users.password_reset_token.' . $token])
        );
    }
public static function findByPasswordResetToken ( $ token , $ checkTokenValid = true ) { if ( $ checkTokenValid && ! self :: isPasswordResetTokenValid ( $ token ) ) { return null ; } return self :: getDb ( ) -> cache ( function ( $ db ) use ( $ token ) { return static :: findOne ( [ 'password_reset_token' => $ token , 'user_status' => [ self :: STATUS_ACTIVE , self :: STATUS_CONFIRMED ] ] ) ; } , self :: $ CACHE_TTL , new TagDependency ( [ 'tags' => 'Users.password_reset_token.' . $ token ] ) ) ; }
Finds user by password reset token
 @param string $token password reset token
 @param bool $checkTokenValid
 @return Users|null
Finds user by password reset token @param string $token password reset token @param bool $checkTokenValid @return Users|null
//return static::findOne(['password_reset_token' => $token, 'user_status' => [self::STATUS_ACTIVE, self::STATUS_CONFIRMED]]);