Angular πŸ‡ΊπŸ‡¦ - practical notes
1.63K subscribers
1.6K photos
1 file
532 links
Angular - practical notes

This group is for posting practical notes for Angular developers. Mostly all posts are for quick implementation https://t.me/angular_practical_notes (Commenting on posts only in ENG and UA langs here). Welcome!
Download Telegram
πŸ“„KeycloakAuthGuard in Angular

#angular #guard #keycloak #mapToCanActivate

🚩 > Angular v16

Add the guard function to your route’s canActivate property.

// In your routing module
{
path: 'protected-route',
canActivate: [keycloakFunctionalGuard],
component: ProtectedComponent
}


⚠️ Using mapToCanActivate Helper
If you’re not ready to fully migrate to functional guards, Angular 16 provides a helper function, mapToCanActivate, that allows you to continue using your class-based guards.

{
path: 'protected-route',
canActivate: mapToCanActivate([wrappedAuthGuard]),
component: ProtectedComponent
}


βœ… Article link: https://medium.com/@kapincev/migrating-keycloakauthguard-to-angular-16-functional-guards-01bf2a20fc09
πŸ–€πŸ€ Keycloak for Angular 19+

#angular #keycloak

βœ… Article Link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1