Custom Authotization problem

Notice: This thread is very old.
albertosanchezm
Member | 12
+
0
-

Hello,

I've just want to redefine the Authorization methods for consulting a DB, as is explained in https://doc.nette.org/…cess-control#…

But, when I enter the lines

common:
    services:
        authenticator: MyAuthenticator

In the config.neon file, an exception is raised:

Nette\InvalidStateException

Found sections ‘common’ in configuration, but corresponding extensions are missing.

Thanks in advanced for your heplp. Here is my complete config.neon file:

parameters:
	php:
		date.timezone: Europe/Prague
		# zlib.output_compression: yes

nette:
	application:
		errorPresenter: Error
		mapping:
			*: App\*Module\*Presenter
	session:
		expiration: 14 days

common:
	services:
		authenticator: CSAuthenticator

services:
	- Model\UserManager
	- App\RouterFactory
	router: @App\RouterFactory::createRouter`
Badaboom
Member | 33
+
0
-

Omit

common:

It refers to config sections. However, it's recommended to use separate configs instead.

Make sure you have formatted the text properly next time. Config files are very indentation dependent and without using formatting, the indentation is lost. Not mentioning a readability.

Last edited by Badaboom (2014-02-15 19:51)

pave.kucera
Member | 122
+
0
-

Hi,

using sections in config has been deprecated (2.1 or 2.0 I think), use multiple config files instead. Just remove the line with common and merge the services parts.

Damn, I opened the tab and responded only after some time, that's why the duplicit answer.

Last edited by pave.kucera (2014-02-15 20:08)

albertosanchezm
Member | 12
+
0
-

Thanks you guys. Now it's working.