Skip to content

[Bug fix] Allow to disable authorize #466

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions DependencyInjection/FOSOAuthServerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ public function load(array $configs, ContainerBuilder $container)
$ormEntityManagerDefinition->setFactory([new Reference('doctrine'), 'getManager']);
}

if (!empty($config['authorize'])) {
$this->loadAuthorize($config['authorize'], $container, $loader);
if (empty($config['authorize'])) {
return;
}

$this->loadAuthorize($config['authorize'], $container, $loader);
Copy link
Contributor

@dinamic dinamic Jan 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this change doing the exact same thing? How does it work?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not the same thing as my version exit the function, so lines 99->104 won't be executed. In original version, they are executed even if authorize feature is disabled, which is a bug IMO.
Still waiting for the team to review & merge this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version 1.6 is about to be tagged soon. We may be able to squeeze this in.

I think you would have better chance of this getting thru if you solve the conflicts. Unit testing the change would be nice too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts solved, but this class is not unit tested

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I was mislead by the presence of the test file.


// Authorize form factory definition
// TODO: Go back to xml configuration when bumping the requirement to Symfony >=2.6
$authorizeFormDefinition = $container->getDefinition('fos_oauth_server.authorize.form');
Expand Down