Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3', '8.4']
php-version: ['8.2', '8.3', '8.4']
db-type: [sqlite, mysql, pgsql]
prefer-lowest: ['']

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ composer.lock
.php_cs*
/coverage
.phpunit.result.cache
.phpunit.cache
/config/Migrations/schema-dump-default.lock
33 changes: 22 additions & 11 deletions Docs/Documentation/Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ logic will be performed if you don't assign an array to result, but if
you set it we will use as redirect url.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -41,7 +42,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_BEFORE_LOGOUT => 'beforeLogout',
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_LOGOUT => 'beforeLogout',
];
}

Expand Down Expand Up @@ -75,6 +76,7 @@ object and the controller object.
You can also populate the new user entity or stop the register process.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -90,7 +92,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_BEFORE_REGISTER => 'beforeRegister',
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_REGISTER => 'beforeRegister',
];
}

Expand Down Expand Up @@ -136,6 +138,7 @@ have access to 'location' and 'request' keys in the event object and
the controller object.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -151,7 +154,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
];
}

Expand Down Expand Up @@ -183,6 +186,7 @@ the social behavior object.
You can also set a new user entity object as result.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -198,7 +202,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
\CakeDC\Users\UsersPlugin::EVENT_BEFORE_SOCIAL_LOGIN_REDIRECT => 'beforeSocialLoginRedirect',
];
}

Expand Down Expand Up @@ -229,6 +233,7 @@ have access to user data. You can also set an array as result to
perform a custom redirect.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -247,7 +252,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_AFTER_LOGIN => 'afterLogin',
\CakeDC\Users\UsersPlugin::EVENT_AFTER_LOGIN => 'afterLogin',
];
}

Expand Down Expand Up @@ -281,6 +286,7 @@ have access to user data and the controller object. You can also
set an array as result to perform a custom redirect.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -296,7 +302,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_AFTER_LOGOUT => 'afterLogout',
\CakeDC\Users\UsersPlugin::EVENT_AFTER_LOGOUT => 'afterLogout',
];
}

Expand Down Expand Up @@ -332,6 +338,7 @@ set a custom http response as result to render a different content
or perform a custom redirect.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -347,7 +354,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_AFTER_REGISTER => 'afterRegister',
\CakeDC\Users\UsersPlugin::EVENT_AFTER_REGISTER => 'afterRegister',
];
}

Expand Down Expand Up @@ -383,6 +390,7 @@ you have access to some user data and the controller object. You can also
set an array as result to perform a custom redirect.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -398,7 +406,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_AFTER_CHANGE_PASSWORD => 'afterChangePassword',
\CakeDC\Users\UsersPlugin::EVENT_AFTER_CHANGE_PASSWORD => 'afterChangePassword',
];
}

Expand Down Expand Up @@ -433,6 +441,7 @@ When adding a custom logic to execute after sending the token for user
validation you can also set an array as result to perform a custom redirect.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -448,7 +457,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_AFTER_RESEND_TOKEN_VALIDATION => 'afterResendTokenValidation',
\CakeDC\Users\UsersPlugin::EVENT_AFTER_RESEND_TOKEN_VALIDATION => 'afterResendTokenValidation',
];
}

Expand Down Expand Up @@ -482,6 +491,7 @@ you have access to some user data and the controller object. You can also
set an array as result to perform a custom redirect.

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -497,7 +507,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
\CakeDC\Users\UsersPlugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
];
}

Expand Down Expand Up @@ -530,6 +540,7 @@ I want to add custom logic after user email is validated to autologin user
This is how you can autologin the user after email is validate:

- Create or update file src/Event/UsersListener.php:

```php
<?php

Expand All @@ -545,7 +556,7 @@ class UsersListener implements EventListenerInterface
public function implementedEvents(): array
{
return [
\CakeDC\Users\Plugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
\CakeDC\Users\UsersPlugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION => 'afterEmailTokenValidation',
];
}

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.1",
"cakephp/cakephp": "^5.0",
"cakephp/cakephp": "5.3.0-RC2",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be adjusted/reverted after CakePHP 5.3 has released

"cakedc/auth": "^10.1",
"cakephp/authorization": "^3.0",
"cakephp/authentication": "^3.0"
Expand Down Expand Up @@ -88,9 +88,9 @@
"test": "phpunit --stderr",
"stan": "phpstan analyse src/",
"psalm": "php vendor/psalm/phar/psalm.phar --show-info=false src/ ",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~1.9.0 psalm/phar:~5.1.0 && mv composer.backup composer.json",
"stan-rebuild-baseline": "phpstan analyse --configuration phpstan.neon --error-format baselineNeon src/ > phpstan-baseline.neon",
"psalm-rebuild-baseline": "php vendor/psalm/phar/psalm.phar --show-info=false --set-baseline=psalm-baseline.xml src/",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~2.1.0 psalm/phar:~6.14.0 && mv composer.backup composer.json",
"stan-rebuild-baseline": "phpstan analyse --generate-baseline",
"psalm-rebuild-baseline": "php vendor/psalm/phar/psalm.phar --show-info=false --set-baseline=psalm-baseline.xml",
"rector": "rector process src/",
"rector-setup": "cp composer.json composer.backup && composer require --dev rector/rector:^0.11.2 && mv composer.backup composer.json",
"coverage-test": "phpunit --stderr --coverage-clover=clover.xml"
Expand Down
Loading
Loading