Skip to content

Commit

Permalink
Merge pull request #35 from khalwat/develop-v5
Browse files Browse the repository at this point in the history
fix: set `useForAllRequests` to `true`, closes: #34
  • Loading branch information
michtio authored Jan 7, 2025
2 parents 30f1f7d + 2964017 commit 972bae2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/PasswordPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,16 @@
use craft\web\twig\variables\CraftVariable;
use craft\web\UrlManager;
use craft\web\View;

use craftpulse\passwordpolicy\assetbundles\passwordpolicy\PasswordPolicyAsset;
use craftpulse\passwordpolicy\models\SettingsModel;
use craftpulse\passwordpolicy\rules\UserRules;
use craftpulse\passwordpolicy\services\ServicesTrait;
use craftpulse\passwordpolicy\utilities\RetentionUtility;
use craftpulse\passwordpolicy\variables\PasswordPolicyVariable;

use Monolog\Formatter\LineFormatter;

use nystudio107\pluginvite\services\VitePluginService;
use nystudio107\pluginvite\services\ViteService;
use Psr\Log\LogLevel;
use Throwable;
use Yii;
use yii\base\Event;
use yii\base\InvalidRouteException;
use yii\log\Dispatcher;
Expand Down Expand Up @@ -76,31 +71,27 @@ class PasswordPolicy extends Plugin

// Public Properties
// =========================================================================
/**
* @var null|SettingsModel
*/
public static ?SettingsModel $settings = null;
/**
* @var string
*/
public string $schemaVersion = '1.0.0';

/**
* @var bool
*/
public bool $hasCpSection = true;

/**
* @var bool
*/
public bool $hasCpSettings = true;

/**
* @var mixed|object|null
*/
public mixed $queue = null;

/**
* @var null|SettingsModel
*/
public static ?SettingsModel $settings = null;

public function init(): void
{
parent::init();
Expand Down Expand Up @@ -208,7 +199,7 @@ protected function settingsHtml(): ?string
{
return Craft::$app->getView()->renderTemplate(
'password-policy/_settings',
[ 'settings' => $this->getSettings() ]
['settings' => $this->getSettings()]
);
}

Expand Down Expand Up @@ -284,13 +275,6 @@ function(TemplateEvent $event) {
// Register Asset Bundle
$view->registerAssetBundle(PasswordPolicyAsset::class);

//$tagOptions = [
// 'depends' => [
// 'craftpulse\\passwordpolicy\\assetbundles\\passwordpolicy\\PasswordPolicyAsset'
// ],
//];
$manifestPath = '@craftpulse/passwordpolicy/web/assets/dist/';
$this->vite->manifestPath = rtrim(Yii::getAlias($manifestPath), '/\\');
//$this->vite->manifestPath = $manifestPath;
$this->vite->register('src/js/indicator.ts', false);
}
Expand Down
1 change: 1 addition & 0 deletions src/services/ServicesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static function config(): array
'vite' => [
'assetClass' => PasswordPolicyAsset::class,
'checkDevServer' => true,
'useForAllRequests' => true,
'class' => VitePluginService::class,
'devServerInternal' => 'http://craft-password-policy-v5-buildchain-dev:3005',
'devServerPublic' => 'http://localhost:3005',
Expand Down

0 comments on commit 972bae2

Please sign in to comment.