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

Move referer and user agent retrieval to if-statement header #17

Closed
wants to merge 1 commit into from

Conversation

lennartdiedrich
Copy link

Currently it is not possible to access the default Auth Component using Shopware()->Auth() before the onPreDispatchBackend of the Auth-Plugin has been executed. The instantiation of the Auth Component using onInitResourceAuth and onInitResourceBackendSession requires the $request property to be set, which happens in the onPreDispatchBackend method.

This patch allows to use the Auth Component, at least when the referer and client checks are not executed, by retrieving the referer and user agent from the request only when the checks are enabled.

The reason for this requirement is that we need to execute our own custom onPreDispatchBackend method before the default handlers onPreDispatchBackend method has been executed, because we adapted the backend login process to support preemptive HTTP Basic Authentication.

Maybe there's a better solution for this specific problem, but at least this pull request increases the performance a little bit by avoiding unnecessary variable instantiation.

@OliverSkroblin
Copy link
Contributor

Hello lennartdiedrich,

your pull request has been merged.

Commit: 1f80bc6

Thanks for your contribution.

best regards

Oliver Denter

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.

None yet

2 participants