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

Docs claim wrong event priorities #6

Open
weierophinney opened this issue Dec 31, 2019 · 0 comments
Open

Docs claim wrong event priorities #6

weierophinney opened this issue Dec 31, 2019 · 0 comments

Comments

@weierophinney
Copy link
Contributor

The event priorities listed in the docs are not the actual priorities used in the code.
MvcRouteListener has:

public function attach(EventManagerInterface $events)
{
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authentication'], -50);
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authenticationPost'], -51);
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authorization'], -600);
    $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'authorizationPost'], -601);
}

The docs have them listed with the priorities: 500, 499, -600, -601 respectively.

I tried fixing the code to match the docs, but then it triggers before routing happens (priority 1), so a negative priority makes sense, but is there a reason to have it as late as -50? I'm trying to use ZfcRbac together with this and it runs the guards at priority -6, so it fails those checks because it doesn't have an identity yet.


Originally posted by @dkmuir at zfcampus/zf-mvc-auth#115

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

No branches or pull requests

1 participant