File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public async Task<ActionResult<AuthResponse>> Authenticate([FromBody] DTO.LoginR
3838 var user = await _db . Users
3939 . Include ( u => u . UserRoles )
4040 . ThenInclude ( ur => ur . Role )
41- . FirstOrDefaultAsync ( u => u . UserName == req . UserName && u . Password == req . Password ) ;
41+ . FirstOrDefaultAsync ( u => u . UserName == req . UserName && u . Password == BCrypt . Net . BCrypt . HashPassword ( req . Password ) ) ;
4242
4343 if ( user == null )
4444 return Unauthorized ( "Invalid credentials." ) ;
Original file line number Diff line number Diff line change 9191if ( app . Environment . IsDevelopment ( ) )
9292{
9393 app . MapOpenApi ( ) ;
94+ app . UseSwagger ( ) ;
95+ app . UseSwaggerUI ( c =>
96+ {
97+ c . SwaggerEndpoint ( "/swagger/v1/swagger.json" , "User Management API v1" ) ;
98+ c . RoutePrefix = string . Empty ; // Swagger UI at root "/"
99+ } ) ;
94100}
95101
96102app . UseHttpsRedirection ( ) ;
Original file line number Diff line number Diff line change 44 "http" : {
55 "commandName" : " Project" ,
66 "dotnetRunMessages" : true ,
7- "launchBrowser" : false ,
7+ "launchBrowser" : true ,
88 "applicationUrl" : " http://localhost:5004" ,
99 "environmentVariables" : {
1010 "ASPNETCORE_ENVIRONMENT" : " Development"
1313 "https" : {
1414 "commandName" : " Project" ,
1515 "dotnetRunMessages" : true ,
16- "launchBrowser" : false ,
16+ "launchBrowser" : true ,
1717 "applicationUrl" : " https://localhost:7093;http://localhost:5004" ,
1818 "environmentVariables" : {
1919 "ASPNETCORE_ENVIRONMENT" : " Development"
You can’t perform that action at this time.
0 commit comments