Using email instead of username in CakePHP Auth Component

后端 未结 1 385
清酒与你
清酒与你 2021-01-20 03:25

I am working on cakephp 2.x . my problem is i dont want to use username for logging .. i am taking the email and password from the user and verify this email and password fr

相关标签:
1条回答
  • 2021-01-20 03:58

    You can configure it with:

    public $components = array(
        'Auth' => array(
            'authenticate' => array(
                'Form' => array(
                    'fields' => array('username' => 'email')
                )
            )
        )
    );
    

    See also Configuring Authentication handlers in the cookbook.

    0 讨论(0)
提交回复
热议问题