Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to a member function decrypt() on null #2472

Closed
Thaars opened this issue Dec 13, 2019 · 0 comments
Closed

Call to a member function decrypt() on null #2472

Thaars opened this issue Dec 13, 2019 · 0 comments

Comments

@Thaars
Copy link

@Thaars Thaars commented Dec 13, 2019

Describe the bug
When I use the X-XSRF TOKEN header, the VerifyCsrfToken middleware needs the encrypter that is injected into the parent (Illuminate\Foundation\Http\Middleware\VerifyCsrfToken) constructor. It was overwritten by the Statamic\Http\Middleware\VerifyCsrfToken constructor, but the injection is missing.

Expected behavior
The X-XSRF-TOKEN verification should work as expected.
This works:

   /**
     * VerifyCsrfToken constructor.
     *
     * @param  \Illuminate\Contracts\Encryption\Encrypter  $encrypter
     */
    public function __construct(Encrypter $encrypter)
    {
        $this->except = Config::get('system.csrf_exclude', []);

        parent::__construct($encrypter);
    }

Environment details (please complete the following information):

  • Statamic Version 2.11.15
  • Fresh Install
  • OS: macOS 10.15.1
  • Browser: Postman
  • Web Server: Apache
  • PHP Version: 7.3.8
  • Addons installed:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.