remove this Microsoft.IdentityModel.Tokens then the jwt is worked
This commit is contained in:
+17
-18
@@ -103,12 +103,6 @@ namespace CarParkValidationAPI
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
*/
|
||||
app.UseMiddleware<ErrorHandlerMiddleware>(); // use this exception
|
||||
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
// global cors policy
|
||||
app.UseCors(x => x
|
||||
@@ -118,22 +112,27 @@ namespace CarParkValidationAPI
|
||||
.WithExposedHeaders("Content-Disposition")
|
||||
|
||||
.AllowCredentials());
|
||||
|
||||
// global error handler
|
||||
//app.UseMiddleware<ErrorHandlerMiddleware>();
|
||||
|
||||
// custom jwt auth middleware
|
||||
app.UseMiddleware<JwtMiddleware>();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
app.UseMiddleware<ErrorHandlerMiddleware>(); // use this exception
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
|
||||
|
||||
});
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user