Skip to content

Answer:66#1469

Closed
T-DiegoF wants to merge 2 commits intotomalaforge:mainfrom
T-DiegoF:feat/challenge-66-functional-auth-guard
Closed

Answer:66#1469
T-DiegoF wants to merge 2 commits intotomalaforge:mainfrom
T-DiegoF:feat/challenge-66-functional-auth-guard

Conversation

@T-DiegoF
Copy link
Copy Markdown

@T-DiegoF T-DiegoF commented Apr 4, 2026

Migrated class-based guards to functional CanActivateFn and refactored AuthService to use Angular Signals.

Changes

  • AuthService: replaced plain boolean/string properties with signal(), exposed them via asReadonly(), added isAdmin as a computed() signal
  • authGuard / adminGuard: replaced @Injectable classes implementing CanActivate with plain CanActivateFn functions using inject()
  • Guards return router.createUrlTree(['/']) instead of imperative router.navigate()
  • app.routes.ts: updated to reference the functional guards directly

T-DiegoF and others added 2 commits April 4, 2026 19:13
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added answer answer 66 labels Apr 4, 2026
@T-DiegoF T-DiegoF closed this Apr 4, 2026
@T-DiegoF T-DiegoF deleted the feat/challenge-66-functional-auth-guard branch April 4, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant