Skip to content

Conversation

@dereuromark
Copy link
Member

@dereuromark dereuromark commented Feb 9, 2026

Summary

Updates the CMS tutorial authentication documentation for Authentication plugin v4.

API Updates for v4

  • Updated version requirement from ~3.0 to ~4.0
  • Replaced deprecated addUnauthenticatedActions() with allowUnauthenticated()
  • Replaced Router::url() strings with array URLs for better maintainability
  • Used setConfig() method instead of constructor args for service configuration
  • Used AbstractIdentifier::CREDENTIAL_* constants for field mapping
  • Used getLoginRedirect() method for handling post-login redirects
  • Simplified login action (removed redundant allowMethod(), cleaner flash message logic)
  • Simplified logout action (no need to check if authenticated first)

VitePress Enhancements

  • Added ::: code-group tabs for related code blocks (middleware/service, controller/template)
  • Added line highlighting {3,12-18} for important additions
  • Added ::: tip, ::: info, ::: warning, ::: details containers
  • Added summary table for the three authentication classes
  • Used [!code ++] diff annotation for new middleware line
  • Restructured with clearer subsections (Configuring the Application, Configuring the AppController, etc.)

Based on:

@josbeir
Copy link
Contributor

josbeir commented Feb 9, 2026

ask your ai to use "improve this page using vitepress markdown extensions like code grouping, and others that could improve cognitive load" to give it that extra sauce ;-)

@dereuromark dereuromark force-pushed the update-cms-auth-tutorial-v4 branch from 27aaf24 to 13e18ca Compare February 9, 2026 18:39
@dereuromark dereuromark marked this pull request as ready for review February 9, 2026 18:39
Updates for v4 API:
- Update version requirement to ~4.0
- Use allowUnauthenticated() instead of deprecated addUnauthenticatedActions()
- Use array URLs instead of Router::url() strings
- Use setConfig() method for service configuration
- Use AbstractIdentifier constants for field mapping
- Use getLoginRedirect() for handling post-login redirects
- Simplify login/logout actions

VitePress enhancements for better readability:
- Add code-group tabs for related code (middleware/service, controller/template)
- Add line highlighting {3,12-18} for important additions
- Add ::: tip, ::: info, ::: warning, ::: details containers
- Add summary table for authentication classes
- Use [!code ++] diff annotation for new code
- Restructure with clearer subsections
@dereuromark dereuromark force-pushed the update-cms-auth-tutorial-v4 branch from 13e18ca to dd97e57 Compare February 9, 2026 18:40
@dereuromark
Copy link
Member Author

Done :)

@dereuromark dereuromark requested a review from josbeir February 9, 2026 18:51
@josbeir josbeir merged commit c19099a into 5.x Feb 9, 2026
5 checks passed
@josbeir josbeir deleted the update-cms-auth-tutorial-v4 branch February 9, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants