diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e91851..d22cc7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 0.2.1 + +### Fixed + +- Application crash on initialization. + ## 0.2.0 - 2019-10-06 ### Added diff --git a/composer.json b/composer.json index 6cd5940..a3420de 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "edenspiekermann/craft-jwt-auth", "description": "Enable authentication to Craft through the use of JSON Web Tokens (JWT)", "type": "craft-plugin", - "version": "0.2.0", + "version": "0.2.1", "keywords": [ "craft", "cms", diff --git a/src/CraftJwtAuth.php b/src/CraftJwtAuth.php index 879b4d9..e7b8ae7 100644 --- a/src/CraftJwtAuth.php +++ b/src/CraftJwtAuth.php @@ -58,7 +58,7 @@ public function init() parent::init(); self::$plugin = $this; - Craft::$app->on(Application::EVENT_INIT, function (Event $event) { + Event::on(Application::class, Application::EVENT_INIT, function (Event $event) { $token = self::$plugin->jWT->parseAndVerifyJWT(self::$plugin->jWT->getJWTFromRequest()); // If the token passes verification...