{"action":"opened","issue":{"url":"https://api.github.com/repos/CakeDC/users/issues/326","repository_url":"https://api.github.com/repos/CakeDC/users","labels_url":"https://api.github.com/repos/CakeDC/users/issues/326/labels{/name}","comments_url":"https://api.github.com/repos/CakeDC/users/issues/326/comments","events_url":"https://api.github.com/repos/CakeDC/users/issues/326/events","html_url":"https://github.com/CakeDC/users/issues/326","id":142253027,"number":326,"title":"Config should not be initialized like this","user":{"login":"CodeBlastr","id":393946,"avatar_url":"https://avatars.githubusercontent.com/u/393946?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeBlastr","html_url":"https://github.com/CodeBlastr","followers_url":"https://api.github.com/users/CodeBlastr/followers","following_url":"https://api.github.com/users/CodeBlastr/following{/other_user}","gists_url":"https://api.github.com/users/CodeBlastr/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeBlastr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeBlastr/subscriptions","organizations_url":"https://api.github.com/users/CodeBlastr/orgs","repos_url":"https://api.github.com/users/CodeBlastr/repos","events_url":"https://api.github.com/users/CodeBlastr/events{/privacy}","received_events_url":"https://api.github.com/users/CodeBlastr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-21T04:22:16Z","updated_at":"2016-03-21T04:22:16Z","closed_at":null,"body":"I'm looking to start a discussion about how this could be done differently, because it does not play nice with theme plugins.  \r\n\r\n```php\r\n  // in /src/Controller/Component/UsersAuthComponent.php\r\n  protected function _initAuth()\r\n    {\r\n        if (Configure::read('Users.auth')) {\r\n            //initialize Auth\r\n            $this->_registry->getController()->loadComponent('Auth', Configure::read('Auth'));\r\n        }\r\n```\r\nhttps://github.com/CakeDC/users/blob/master/src/Controller/Component/UsersAuthComponent.php#L98\r\n\r\n\r\nIt seems to me that instead of this it should pass the config values set in the initialize method.  Something like...\r\n\r\n```php\r\n    public function initialize(array $config)\r\n    {\r\n        parent::initialize($config);\r\n        $this->config = $config;\r\n```\r\n\r\n```php\r\n  protected function _initAuth()\r\n    {\r\n        if (Configure::read('Users.auth')) {\r\n            //initialize Auth\r\n            $this->_registry->getController()->loadComponent('Auth', $this->config);\r\n        }\r\n```\r\n\r\nHere's an issue opened on a theme plugin, which demonstrates the reason... https://github.com/FriendsOfCake/bootstrap-ui/pull/141#issuecomment-199103399\r\n\r\nIf this isn't a good idea, then what is the suggested way that theme plugins like https://github.com/FriendsOfCake/bootstrap-ui should have their alert templates and settings respected by https://github.com/CakeDC/users? \r\n\r\n"}}