refactor: set HttpOnly for debug mode too
This commit is contained in:
parent
565252382c
commit
dee89b278b
@ -75,9 +75,9 @@ public partial class SetupController(
|
|||||||
{
|
{
|
||||||
Path = UrlHelper.GetSubPathWithoutFirstApiName + "api",
|
Path = UrlHelper.GetSubPathWithoutFirstApiName + "api",
|
||||||
Domain = HttpContext.GetCurrentDomain(),
|
Domain = HttpContext.GetCurrentDomain(),
|
||||||
|
HttpOnly = true,
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
Secure = true,
|
Secure = true
|
||||||
HttpOnly = true
|
|
||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
|
@ -31,9 +31,9 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
|
|||||||
Expires = expires,
|
Expires = expires,
|
||||||
Path = UrlHelper.GetSubPathWithoutFirstApiName + "api",
|
Path = UrlHelper.GetSubPathWithoutFirstApiName + "api",
|
||||||
Domain = HttpContext.GetCurrentDomain(),
|
Domain = HttpContext.GetCurrentDomain(),
|
||||||
|
HttpOnly = true,
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
Secure = true,
|
Secure = true
|
||||||
HttpOnly = true
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -49,9 +49,9 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
|
|||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public void OnActionExecuting(ActionExecutingContext context)
|
public void OnActionExecuting(ActionExecutingContext context)
|
||||||
{
|
{
|
||||||
Ip = context.HttpContext.Connection.RemoteIpAddress?.ToString()!;
|
Ip = HttpContext.Connection.RemoteIpAddress?.ToString()!;
|
||||||
UserAgent = context.HttpContext.Request.Headers.UserAgent.ToString();
|
UserAgent = Request.Headers.UserAgent.ToString();
|
||||||
Fingerprint = context.HttpContext.Request.Cookies["user_key"] ?? string.Empty;
|
Fingerprint = Request.Cookies["user_key"] ?? string.Empty;
|
||||||
RefreshToken = Request.Cookies["refresh_token"] ?? string.Empty;
|
RefreshToken = Request.Cookies["refresh_token"] ?? string.Empty;
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(Fingerprint)) return;
|
if (!string.IsNullOrWhiteSpace(Fingerprint)) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user