Hi, I’m using CakePHP 4.0.7 and new to CakePHP. I’ve followed the CMS tutorial in the Cookbook. Now I’m trying to learn how to use the TinyAuth plugin. Step I’ve taken is:
-
Install new CakePHP 4.0.7 and connect to database
-
Install TinyAuth using composer - composer require dereuromark/cakephp-tinyauth
-
Load plugin: $this->addPlugin(‘TinyAuth’); at …/src/Application.php
public function bootstrap(): void
{
$this->addPlugin(‘TinyAuth’);
// Call parent to load bootstrap from files.
parent::bootstrap();
if (PHP_SAPI === ‘cli’) {
$this->bootstrapCli();
} -
Generate auth_allow.ini in the config folder.
-
Create Users table [id,email,password]
-
Bake the users table and access localhost/users. I managed to view the index and add to register a new account. However, the password is not hashed and the login controller is not defined.
Do I need to add the protected function _setPassword in the model? Then create the public function login in controller and login form in …/template/users? Does the TinyAuth plugin still require Authentication plugin to be install? Sorry for the very basic question but I’m interested to know how this plugin works. Thank you.