Hide inserted estimates from client list; redirect anon to /signin
Estimates with status Inserted (provider hasn't worked on them yet) were showing up in the client's "Mes devis à valider" list. The asclient endpoint now requires ProviderValidationDate to be set, so only estimates the provider has actually established and submitted are visible to the client. The asprovider endpoint is unchanged (providers still need to see incoming unprocessed requests). Also fix the anonymous-access redirect on Yavsc.Org: the application cookie's LoginPath defaulted to /Account/Login, which has no controller. Anonymous hits to a restricted page now redirect to the real /signin endpoint (with /signout and /Account/AccessDenied set to match the existing controller routes). Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
parent
60c10781f0
commit
22c33c5388
4 changed files with 70 additions and 3 deletions
|
|
@ -215,6 +215,18 @@ public static class HostingExtensions
|
|||
|
||||
services.AddScoped<IUserClaimsPrincipalFactory<ApplicationUser>, UserClaimsPrincipalFactory<ApplicationUser, IdentityRole>>();
|
||||
|
||||
// The default application cookie LoginPath is "/Account/Login", which
|
||||
// has no controller here — anonymous access to a restricted page must
|
||||
// redirect to the actual sign-in endpoint instead. The paths mirror
|
||||
// the route attributes on AccountController (Constants.SigninPath etc.,
|
||||
// which carry a "~/" prefix that the cookie middleware does not want).
|
||||
services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
options.LoginPath = "/signin";
|
||||
options.LogoutPath = "/signout";
|
||||
options.AccessDeniedPath = "/Account/AccessDenied";
|
||||
});
|
||||
|
||||
// Dev-only: Chromium rejects SameSite=None without Secure on http://
|
||||
// (e.g. http://localhost:5000). The default Identity cookie policy
|
||||
// sets SameSite=None, which is invalid without Secure. Force Lax in
|
||||
|
|
|
|||
Loading…
Reference in a new issue