commented dadeschool authencation logic

This commit is contained in:
Vijay Uppu 2023-11-21 13:30:30 -05:00
parent cd982d160a
commit bdde55b3e5
2 changed files with 13 additions and 12 deletions

View File

@ -14,17 +14,17 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
{ {
this.userAccessProvider = userAccessProvider; this.userAccessProvider = userAccessProvider;
} }
[HttpPost("dadeschooltoken")] // [HttpPost("dadeschooltoken")]
public async Task<ActionResult> DadeSchoolAuthenticateAsync(string username, string password) // public async Task<ActionResult> DadeSchoolAuthenticateAsync(string username, string password)
{ {
var result = await userAccessProvider.DadeSchoolAuthenticateAsync(username, password); // var result = await userAccessProvider.DadeSchoolAuthenticateAsync(username, password);
if (result.IsSuccess) // if (result.IsSuccess)
{ // {
return Ok(result.TokenResponse); // return Ok(result.TokenResponse);
} // }
return Unauthorized(result.ErrorMessage); // return Unauthorized(result.ErrorMessage);
} // }
[Authorize(Policy = "Dadeschools")] // [Authorize(Policy = "Dadeschools")]
[HttpPost("token/{employecode}")] [HttpPost("token/{employecode}")]
public async Task<ActionResult> AuthenticateAsync(string employecode) public async Task<ActionResult> AuthenticateAsync(string employecode)
{ {
@ -36,7 +36,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
return Unauthorized(result.ErrorMessage); return Unauthorized(result.ErrorMessage);
} }
[Authorize(Policy = "Dadeschools")] // [Authorize(Policy = "Dadeschools")]
[HttpPost("refreshtoken")] [HttpPost("refreshtoken")]
public async Task<ActionResult> RefreshTokenAsync(TokenResponse tokenResponse) public async Task<ActionResult> RefreshTokenAsync(TokenResponse tokenResponse)
{ {

View File

@ -10,7 +10,8 @@ $microservices = @(
"DamageAssesment.Api.Locations", "DamageAssesment.Api.Locations",
"DamageAssesment.Api.Questions", "DamageAssesment.Api.Questions",
"DamageAssesment.Api.Responses", "DamageAssesment.Api.Responses",
"DamageAssesment.Api.Surveys" "DamageAssesment.Api.Surveys",
"DamageAssesment.Api.UsersAccess"
) )