Skip to content

More details in the README.md #11

@GregoireGaonach

Description

@GregoireGaonach

Hey hi!

Thank you very much for the work you've done here! I juste have one or two questions on how to use your plugin. I installed it via composer and loaded it from the Auth Component.

$this->loadComponent('Auth', [
    'authenticate' => [
        'Form' => [
            'finder' => 'auth'
        ],
        'RememberMe.Cookie' => [
            'cookie' => [
                'name'     => 'rememberMe',
                'expires'  => '+30 days',
                'secure'   => true,
                'httpOnly' => true,
            ],
        ],
    ],
    'loginAction' => [
        'controller' => 'Users',
        'action'     => 'login',
        'prefix'     => false
    ],
    'loginRedirect' => [
        'controller' => 'Pages',
        'action'     => 'home',
        'prefix'     => false
    ],
    'logoutRedirect' => [
        'controller' => 'Pages',
        'action'     => 'home',
        'prefix'     => false
    ],
    'authError' => __("Vous n'êtes pas autorisé à accéder à cette section."),
    'authorize' => ['Controller'], 
]);

Plus in my login form I added the following lines :

<?= $this->Form->create() ?>
    <?= $this->Form->control('username', ['label' => '', 'placeholder' => __('Pseudonyme')]); ?>
    <?= $this->Form->control('password', ['label' => '', 'placeholder' => __('Mot de passe')]); ?>
	<?= $this->Form->control('remember_me', ['type' => 'checkbox', 'label' => __("Se souvenir de moi ?")]); ?>	
	<?= $this->Form->button(__('Connexion')); ?>
<?= $this->Form->end() ?>

Is there anything else that is needed to make the plugin works? After a login, nothing happends and there is no cookie generated.

Maybe I missed something? It would be great if you could add some informations regarding the installation.

I'm using php 7.2.7 and Cakephp 3.7

document.cookie
<- ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions