Skip to content

Commit

Permalink
fixes on use Cores
Browse files Browse the repository at this point in the history
  • Loading branch information
bzashev committed Nov 1, 2023
1 parent 7fb37fc commit f48c3e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions WebVella.Erp.Site/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,19 @@ public void ConfigureServices(IServiceCollection services)
services.AddRouting(options => { options.LowercaseUrls = true; });

//CORS policy declaration
//services.AddCors(options =>
//{
// options.AddPolicy("AllowNodeJsLocalhost",
// builder => builder.WithOrigins("http://localhost:3333", "http://localhost:3000", "http://localhost").AllowAnyMethod().AllowCredentials());
//});
services.AddCors(options =>
{
options.AddPolicy("AllowNodeJsLocalhost",
builder => builder.WithOrigins("http://localhost:3333", "http://localhost:3000", "http://localhost").AllowAnyMethod().AllowCredentials());
options.AddDefaultPolicy(policy =>
policy.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());
});
services.AddDetection();
services.AddDetection();

services.AddMvc()

Expand Down Expand Up @@ -153,7 +160,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
//Should be before Static files
app.UseResponseCompression();

app.UseCors("AllowNodeJsLocalhost"); //Enable CORS -> should be before static files to enable for it too
//app.UseCors("AllowNodeJsLocalhost"); //Enable CORS -> should be before static files to enable for it too
app.UseCors(); //Enable CORS -> should be before static files to enable for it too

app.UseStaticFiles(new StaticFileOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface IAuthenticationService

public class AuthenticationService : IAuthenticationService
{
private const string apiAuthRoot = "api/v3/en_US/auth/jwt/";
private const string apiAuthRoot = "v3/en_US/auth/jwt/";

private readonly HttpClient _httpClient;
private readonly ITokenManagerService _tokenManagerService;
Expand Down

0 comments on commit f48c3e6

Please sign in to comment.