This commit is contained in:
+13
-3
@@ -69,9 +69,19 @@ builder.Services.AddAuthentication(options => {
|
||||
};
|
||||
});
|
||||
|
||||
builder.Services.AddCors(o => o.AddDefaultPolicy(builder => {
|
||||
builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader(); // No CORS
|
||||
}));
|
||||
List<string> allowedOrigins = new List<string>{ "https://auth.mistox.com" };
|
||||
if (builder.Environment.IsDevelopment()) {
|
||||
allowedOrigins.Add("http://localhost:5000");
|
||||
}
|
||||
|
||||
builder.Services.AddCors(options => {
|
||||
options.AddDefaultPolicy(policy => {
|
||||
policy.WithOrigins(allowedOrigins.ToArray())
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod()
|
||||
.AllowCredentials();
|
||||
});
|
||||
});
|
||||
|
||||
// Pages Service
|
||||
builder.Services.AddControllers();
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Auth.Services {
|
||||
new Claim(ClaimTypes.Dns, RequestedSite),
|
||||
new Claim(ClaimTypes.IsPersistent, StayLoggedIn.ToString()),
|
||||
]),
|
||||
Expires = DateTime.UtcNow.AddDays(7),
|
||||
Expires = DateTime.UtcNow.AddMinutes(5),
|
||||
IssuedAt = DateTime.UtcNow,
|
||||
SigningCredentials = new SigningCredentials(RsaPrivateKey, SecurityAlgorithms.RsaSha256),
|
||||
Audience = TokenAudience,
|
||||
|
||||
Reference in New Issue
Block a user