# Migration Guide from 11.x to 13.0

This guide describes the changes needed to upgrade your application from version 11.x to 13.0 of the CakeDC Users plugin.

## CakePHP Version Requirement

Version 13.0 of the CakeDC Users plugin is designed for **CakePHP 4.5+**. If your application is still running on an older version of CakePHP 4, you must upgrade to CakePHP 4.5 before updating the plugin.

## PHP Version Requirement

The minimum PHP version has been increased to **7.4**.

## Dependency Changes

The following dependencies have been updated:

- `cakedc/auth` has been updated to `^9.0`.
- `cakephp/cakephp` requirement is now `^4.5`.
- `web-auth/webauthn-lib` has been updated to `^3.3`.

## 2FA Refactoring

Version 13.0 introduces a refactoring of the Two-Factor Authentication (2FA) system to improve extensibility and maintainability, following changes in the `cakedc/auth` dependency.

If you have customized the 2FA implementation or extended the 2FA components, please review the new structure in `cakedc/auth` version 9.0.

## New Features and Improvements

### Microsoft Login
Support for Microsoft social login has been added. You can now configure `Azure` as a social provider.

### Link Generator for Emails
A new `linkGenerator` configuration option has been added for emails, which is particularly useful for API-driven applications where you need to customize how URLs are generated in system emails.

### Flash Messages on Login
A new feature has been added to display flash messages upon successful login in CakePHP 4.

## Social Authentication Changes

### LinkedIn
Note that compatibility with the LinkedIn OAuth-based connector is now deprecated, as LinkedIn now primarily supports OpenID Connect.

### Microsoft Azure
Added support for Microsoft Azure social login via `thenetworg/oauth2-azure`.

## Configuration Changes

### UsersUrl
The plugin now uses `UsersUrl` to unify URL building for login actions and redirects. If you were manually overriding login URLs, ensure they are compatible with the new URL builder logic.
