Previously the plugin would initialize itself on application load. This is fine, but Craft::$app may be either a craft\web\Application or a craft\console\Application, which are different applications with different use cases.
This PR changes the class that the plugin initialzes on from Craft->$app to craft\web\Application, causing the plugin to not attempt to authenticate a user based on the current headers on console requests.
Definition of Done
[x] Ensure there are no formatting errors
[x] Ensure feature branch has latest development code integrated
[x] Version number in composer.json is updated
[x] New entry added in CHANGELOG.md documenting changes made
I'm running into this issue too. Manually changing the code using this PR fixes the issue for me. This issue occurred after upgrading to CraftCMS 3.6.3
Description
Previously the plugin would initialize itself on application load. This is fine, but
Craft::$app
may be either acraft\web\Application
or acraft\console\Application
, which are different applications with different use cases.As seen in https://github.com/edenspiekermann/craft-jwt-auth/issues/11, this would cause all console requests to crash as the console application resolves a console request, and there is no
craft\console\Request::headers
.This PR changes the class that the plugin initialzes on from
Craft->$app
tocraft\web\Application
, causing the plugin to not attempt to authenticate a user based on the current headers on console requests.Definition of Done
composer.json
is updatedCHANGELOG.md
documenting changes made