Where does the authenticator file go?
- Bill Lions
- Member | 47
I am reading the custom authenticator example on https://doc.nette.org/…thentication
Where does this file go?
What does it need to be called?
Thanks
Bill Lions
- manwe
- Member | 44
Hey Bill!
- Basically, it does not matter where you put it, since Nette uses Finder to find all needed files. It just needs to be in app/ folder.
- You can call it whatever you want, you just need to make sure it implements Nette\Security\IAuthenticator
- Register it in your config.neon file as a service, Nette will take care of the rest.
Last edited by manwe (2019-03-20 08:03)
- Bill Lions
- Member | 47
Thanks,
That worked.. mostly
Do I need to 'use NSI\IAuthenticator or something?
Fatal Error
Interface 'NS\IAuthenticator' not found
- Bill Lions
- Member | 47
Thanks, also, the example only works when
public function __construct(Nette\Database\Connection $database)
is changed to context
public function __construct(Nette\Database\Context $database)