Skip to content

Disable JWT authentication on console requests#14

Open
jackatomix wants to merge 2 commits intoedenspiekermann:developfrom
jackatomix:hotfix-console-headers
Open

Disable JWT authentication on console requests#14
jackatomix wants to merge 2 commits intoedenspiekermann:developfrom
jackatomix:hotfix-console-headers

Conversation

@jackatomix
Copy link
Copy Markdown

Description

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.

As seen in #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 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

  • Ensure there are no formatting errors
  • Ensure feature branch has latest development code integrated
  • Version number in composer.json is updated
  • New entry added in CHANGELOG.md documenting changes made

@jackatomix jackatomix changed the title Hotfix console headers Disable JWT authentication on console requests Aug 27, 2020
@BenMenking
Copy link
Copy Markdown

BenMenking commented Feb 4, 2021

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

Copy link
Copy Markdown

@uwaeae uwaeae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is working for me

Copy link
Copy Markdown

@bmenking-wng bmenking-wng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrects the error. Tested on CraftCMS 3.5 and 3.6

Copy link
Copy Markdown

@bmenking-wng bmenking-wng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were tested on 3.7.x and confirmed working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants