update session stuff
This commit is contained in:
parent
5d7cc52201
commit
c0dc2fdcb9
3 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@ namespace Femto.Api.Auth;
|
||||||
|
|
||||||
public class CookieSettings
|
public class CookieSettings
|
||||||
{
|
{
|
||||||
|
public SameSiteMode SameSite { get; set; }
|
||||||
public bool Secure { get; set; }
|
public bool Secure { get; set; }
|
||||||
public string? Domain { get; set; }
|
public string? Domain { get; set; }
|
||||||
}
|
}
|
|
@ -14,7 +14,7 @@
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": false,
|
"launchBrowser": false,
|
||||||
"applicationUrl": "https://0.0.0.0:7269;http://0.0.0.0:5181",
|
"applicationUrl": "https://stinkpad:7269;http://0.0.0.0:5181",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ internal static class HttpContextSessionExtensions
|
||||||
var cookieSettings = httpContext.RequestServices.GetService<IOptions<CookieSettings>>();
|
var cookieSettings = httpContext.RequestServices.GetService<IOptions<CookieSettings>>();
|
||||||
|
|
||||||
var secure = cookieSettings?.Value.Secure ?? true;
|
var secure = cookieSettings?.Value.Secure ?? true;
|
||||||
var sameSite = secure ? SameSiteMode.None : SameSiteMode.Unspecified;
|
var sameSite = cookieSettings?.Value.SameSite ?? SameSiteMode.Strict;
|
||||||
var domain = cookieSettings?.Value.Domain;
|
var domain = cookieSettings?.Value.Domain;
|
||||||
var expires = session.Expires;
|
var expires = session.Expires;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue