Skip to content
Advertisement

CakePHP DC Users 8.5.1 customising to use email

I have a CakePHP application running on Cake PHP 3.8.13 and CakeDC Users 8.5.1.

I am currently able to log on using the username field, but I would like to use the email field for authentication. I have followed the instructions on https://github.com/CakeDC/users/blob/master/Docs/Documentation/Configuration.md#using-the-users-email-to-login but the system is still trying to use the username field. If I change email to username in the src/Template/Plugin/CakeDC/Users/Users/login.ctp I can log in using the username.

How can I get it to use the email field instead?

src/Application.php

JavaScript

src/config/users.php

JavaScript

src/Template/Plugin/CakeDC/Users/Users/login.ctp

JavaScript

Advertisement

Answer

Add this code

JavaScript

to your pluginBootstrap() function in Application, or ensure the identifier configuration is correctly updated in the config/users.php file, so the plugin will be able to read it and configure Authentication internally.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement