Releases: brammo/auth
Releases · brammo/auth
v1.2.0
Added
Auth.Messages.enumerateAccountsconfig to disable status-specific login error messagesAuth.Authentication.rememberMeFieldconfig for cookie "remember me" checkbox (default:remember_me)Auth.Authentication.sessionKeyconfig option to customize the session key (default:Auth)Auth.Authentication.cookieNameconfig option to customize the remember-me cookie name (default:CookieAuth)Auth.Authentication.rehashPasswordsconfig option to control password rehashing on loginUser::isStatusNew()status helper (notisNew()— conflicts withEntity::isNew())- Bulgarian locale file for plugin template domain
brammo_auth docs/I18N.mdwith translation extraction instructions
Changed
- Login template strings use
__d('brammo_auth', …)domain namefield is optional on create (matches database schema)- Entity password hashing uses
Auth.Authentication.passwordHasherconfiguration - Password rehashing disabled by default (
Auth.Authentication.rehashPasswordsdefaults tofalse) - Minimum PHP version 8.2 (was 8.1)
- Minimum CakePHP version 5.3 (was 5.0)
- Minimum
cakephp/migrationsversion 5.0 (was 4.0)
Fixed
- Duplicate flash render call on login template
- PHPStan level 8 compliance for
UsersTablePHPDoc - PHPStan and Psalm errors
v.1.1.0
Added
- User status field with three values: 'active', 'new', 'blocked'
- Default status is 'new' for newly created users
findActive()finder method on UsersTable to query only active users- Configurable authentication finder via
Auth.Authentication.finderconfig - Configurable error messages for authentication failures:
Auth.Messages.invalidCredentials- Invalid credentials messageAuth.Messages.blocked- Message for blocked usersAuth.Messages.notActivated- Message for inactive/new users
- Status helper methods on User entity:
isActive()- Check if user status is 'active'isBlocked()- Check if user status is 'blocked'
- Status constants on User entity:
User::STATUS_ACTIVE= 'active'User::STATUS_NEW= 'new'User::STATUS_BLOCKED= 'blocked'
- Status validation in UsersTable (must be one of: active, new, blocked)
- Migration
20251127000000_AddStatusToUsersto add status column - Status field in UsersFixture with test users for each status
- Comprehensive tests for all new status functionality
Changed
- UserController now shows status-specific error messages on login failure
- AuthenticationServiceProvider uses configurable finder (default: 'all')
- Updated UsersSeed with status field
Initial release of Brammo/Auth plugin for CakePHP 5.x
Added
- Initial release of Brammo/Auth plugin for CakePHP 5.x
- Complete authentication system with login/logout functionality
- User authentication using CakePHP Authentication library
- Configurable authentication routes (
/login,/logout) - Flexible configuration system via
config/auth.php - Support for multiple authentication methods:
- Session-based authentication
- Form-based authentication
- Cookie-based authentication (Remember Me)
- Password hashing with bcrypt (default)
- Support for legacy password hashers (fallback configuration)
- Password rehashing on login when needed
- Custom login redirect support (query parameter or configuration)
- Plugin bootstrap with automatic configuration loading
- User entity with:
- Hidden password field in JSON output
- Mass-assignable fields (email, password, name)
- Proper field accessibility
- UsersTable with:
- Email validation
- Unique email constraint
- Timestamp behavior
- Validation rules for name, email, password
- UserController with:
- Login action with redirect support
- Logout action
- Flash messages for authentication errors
- Unauthenticated access control
- AuthenticationServiceProvider for service configuration
- Database migrations:
- CreateUsers migration (20231101000000)
- Users table with id, name, email, password, created, modified
- Unique index on email field
- Database seeds:
- UsersSeed with sample admin and test users
- Comprehensive test suite with 37+ test cases:
- PluginTest - Plugin bootstrap and routes
- AuthenticationServiceProviderTest - Service configuration
- UserControllerTest - Login/logout functionality
- UserTest - Entity behavior
- UsersTableTest - Table operations and validation
- Full PHPUnit configuration
- Test fixtures for Users table
- Test application structure for integration testing
- Code style checking with CakePHP CodeSniffer
- Comprehensive documentation:
- Installation and setup guide
- Configuration examples
- Usage examples
- API documentation
- Troubleshooting guide
- Migration documentation