// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); IdentityModelEventSource.ShowPII = true; //capturar erros PII (expiração token) } CorsSetup.UseCorsSetup(app);//deve ficar aqui esta linha app.UseHttpsRedirection(); app.UseRouting(); //app.UseAuthorization();--antiga autorização para swagger(deve ser retirada para o JWT funcionar) //setup para configuração do JWT bearer.. JwtBearerSetup.UseJwtBearerSetup(app); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); //setup para configuração do Swagger.. SwaggerSetup.UseSwaggerSetup(app); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); CorsSetup.UseCorsSetup(app); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); SwaggerSetup.UseSwaggerSetup(app); }