You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: return 401/403 for API endpoints instead of redirecting
Cookie auth's HandleChallengeAsync issues a 302 redirect to the login
page by default. For fetch() API calls this causes the request to follow
the redirect, eventually hitting MapFallbackToController and returning
a user-visible 404.
Add OnRedirectToLogin and OnRedirectToAccessDenied handlers in
ConfigureApplicationCookie that return 401/403 for /api/* paths,
leaving the redirect behavior intact for browser page navigation.
This fixes POST /api/chat/stream returning a 404 for unauthenticated
users instead of a proper 401.
0 commit comments