-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
[RFC] Check the roles in the legacy controllers #1067
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, $this->User->authenticate() redirected to the login screen without access, e.g. also for valid requests but on session timeout. Now we're throwing an exception. That's not really wrong, but is the exception handler somewhere and redirecting to the login screen?
I think if we have Symfony security and form_login firewall (which we will have in the backend), it will redirect if we use the correct exception.
|
Also, you want to change this in 4.5 or also in the LTS version to prevent multiple |
|
I think this gets obsolete with Symfony security. It will check the roles. |
The point of this PR is to prevent the The role check is a completely new feature, which does not change the current behavior at all. In fact, the exception will never be thrown, because if the user would not have the roles, they would have been redirected to the login screen before. |
Actually, we should change this in Contao 4.4, too, because right now the whole authentication routine is run twice. This includes the @contao/developers What do you think? |
@bytehead How is this going to work in the front end? Right now we only check the roles if the page is protected. |
|
@leofeyer looks and acts mostly the same as your proposal here. I'm fine with this. My PR still needs some time. |
Exactly what I asked in #1067 (comment) 😂 |
ed0a7e5
to
3dadd44
Compare
9e6e91f
to
36c967a
Compare
|
See 1ab1524. |
Description ----------- - Commits ------- 2307fcca Also apply the CS fixer to the fixtures
Instead of calling
$this->User->authenticate()twice (one time in theTokenclass and again in the controllers), we should remove the second call and check the roles instead.