[Bug] Hiring: show menu for logged-out users; avoid Keycloak redirect for nav; keep backend protected #39

Closed
opened 2026-04-29 06:08:52 +00:00 by spikerj · 1 comment
Owner

Summary

When not logged in, users should still see the Hiring entry in the navigation/menu (hiring menu component option). Hiring-related data and actions should remain behind authenticated, protected backend endpoints.

Current behavior

Something in the current flow causes users to be redirected to the SpikerSoft Keycloak server when logged out (likely because a protected API or route guard runs too early or for the wrong scope).

Expected behavior

  1. Anonymous users can see the Hiring menu item and navigate to the appropriate public shell/page for hiring (or a landing state that explains login is required for application actions).
  2. Backend calls that require identity or privileged hiring data remain 401/403 protected — not replaced by full-app Keycloak redirects for merely viewing the menu or public framing.
  3. Separate explicit login when the user performs an action that requires auth (e.g. submit application), rather than surprising redirects from menu visibility checks.

Notes / acceptance

  • Hiring menu visible in nav when logged out
  • No unwanted Keycloak redirect solely from rendering or selecting the Hiring menu entry
  • Protected endpoints still enforce auth appropriately for sensitive operations

Area

Frontend navigation / route guards / API client interceptors vs. backend [Authorize] (or equivalent) for hiring flows.

## Summary When **not logged in**, users should still see the **Hiring** entry in the navigation/menu (hiring menu component option). Hiring-related **data and actions** should remain behind **authenticated, protected backend** endpoints. ## Current behavior Something in the current flow causes users to be **redirected to the SpikerSoft Keycloak** server when logged out (likely because a protected API or route guard runs too early or for the wrong scope). ## Expected behavior 1. **Anonymous users** can see the Hiring menu item and navigate to the appropriate public shell/page for hiring (or a landing state that explains login is required for application actions). 2. **Backend calls** that require identity or privileged hiring data remain **401/403 protected** — not replaced by full-app Keycloak redirects for merely viewing the menu or public framing. 3. Separate **explicit** login when the user performs an action that requires auth (e.g. submit application), rather than surprising redirects from menu visibility checks. ## Notes / acceptance - [ ] Hiring menu visible in nav when logged out - [ ] No unwanted Keycloak redirect solely from rendering or selecting the Hiring menu entry - [ ] Protected endpoints still enforce auth appropriately for sensitive operations ## Area Frontend navigation / route guards / API client interceptors vs. backend `[Authorize]` (or equivalent) for hiring flows.
Author
Owner

Resolved -- Guarded getProfile() call behind keycloak.authenticated check in employment.component.ts so logged-out users no longer trigger a 401 → Keycloak redirect. Route was already accessible (no AuthGuard), menu link was already visible, and GetOpenPositions endpoint was already anonymous.

**Resolved** -- Guarded `getProfile()` call behind `keycloak.authenticated` check in `employment.component.ts` so logged-out users no longer trigger a 401 → Keycloak redirect. Route was already accessible (no AuthGuard), menu link was already visible, and `GetOpenPositions` endpoint was already anonymous.
Sign in to join this conversation.