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

Add a CSRF middleware config variable #54

Merged

Conversation

MatanYadaev
Copy link
Contributor

@MatanYadaev MatanYadaev commented Jan 21, 2020

As explained in #53 , Laravel Airlock is blocking the usage of a custom VerifyCsrfToken middleware.
So I added a csrfMiddleware config variable.

I'm very bad with the description stuff, can you guys help me with that? ☺️

@MatanYadaev MatanYadaev changed the title Add CSRF middleware config Add a CSRF middleware config variable Jan 21, 2020
@driesvints
Copy link
Member

Maybe it's just best to check if the local class exists and use that one instead of a config option?

$verifyCsrfToken = class_exists(\App\Http\Middleware\VerifyCsrfToken::class)
    ? \App\Http\Middleware\VerifyCsrfToken::class
    : \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class;

@MatanYadaev
Copy link
Contributor Author

@driesvints I thought about it, but it won't cover cases that this class has a different name.
I guess it's a very edge-case, so maybe it's a better solution, for saving the package as elegant as it is now.

@taylorotwell taylorotwell merged commit 9b201bb into laravel:master Jan 22, 2020
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.

3 participants