Add endpoint to login from mobile

This commit is contained in:
Reginald Cherenfant Jasmin 2023-12-21 16:10:30 -05:00
commit 34b4adf0bf
2 changed files with 9 additions and 9 deletions

View File

@ -19,7 +19,7 @@ namespace DamageAssesment.Api.Employees.Controllers
/// <summary> /// <summary>
/// GET request for retrieving employees. /// GET request for retrieving employees.
/// </summary> /// </summary>
// [Authorize(Roles = "admin")] [Authorize(Roles = "admin")]
[HttpGet("employees")] [HttpGet("employees")]
public async Task<ActionResult> GetEmployeesAsync() public async Task<ActionResult> GetEmployeesAsync()
{ {
@ -36,7 +36,7 @@ namespace DamageAssesment.Api.Employees.Controllers
/// <summary> /// <summary>
/// GET request for retrieving an employee by ID. /// GET request for retrieving an employee by ID.
/// </summary> /// </summary>
// [Authorize(Roles = "admin")] [Authorize(Roles = "admin")]
[HttpGet("employees/{id}")] [HttpGet("employees/{id}")]
public async Task<ActionResult> GetEmployeeByIdAsync(int id) public async Task<ActionResult> GetEmployeeByIdAsync(int id)
{ {

View File

@ -37,7 +37,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)
{ {
@ -49,7 +49,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
return Unauthorized(result.ErrorMessage); return Unauthorized(result.ErrorMessage);
} }
// [Authorize(Policy = "DamageApp", Roles ="admin")] [Authorize(Policy = "DamageApp", Roles = "admin")]
[HttpGet("users")] [HttpGet("users")]
public async Task<ActionResult> GetUsersAsync() public async Task<ActionResult> GetUsersAsync()
{ {
@ -61,7 +61,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
return NoContent(); return NoContent();
} }
// [Authorize(Policy = "DamageApp", Roles = "admin")] [Authorize(Policy = "DamageApp", Roles = "admin")]
[HttpGet("users/{Id}")] [HttpGet("users/{Id}")]
public async Task<ActionResult> GetUsersAsync(int Id) public async Task<ActionResult> GetUsersAsync(int Id)
{ {
@ -73,7 +73,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
return NotFound(); return NotFound();
} }
// [Authorize(Policy = "DamageApp", Roles = "admin")] [Authorize(Policy = "DamageApp", Roles = "admin")]
[HttpGet("roles")] [HttpGet("roles")]
public async Task<ActionResult> GetRolesAsync() public async Task<ActionResult> GetRolesAsync()
{ {
@ -84,7 +84,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
} }
return NoContent(); return NoContent();
} }
// [Authorize(Policy = "DamageApp", Roles = "admin")] [Authorize(Policy = "DamageApp", Roles = "admin")]
[HttpPost("users")] [HttpPost("users")]
public async Task<ActionResult> PostUserAsync(User user) public async Task<ActionResult> PostUserAsync(User user)
{ {
@ -96,7 +96,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
return BadRequest(result.ErrorMessage); return BadRequest(result.ErrorMessage);
} }
// [Authorize(Policy = "DamageApp", Roles = "admin")] [Authorize(Policy = "DamageApp", Roles = "admin")]
[HttpPut("users/{Id}")] [HttpPut("users/{Id}")]
public async Task<ActionResult> PutUserAsync(int Id, User user) public async Task<ActionResult> PutUserAsync(int Id, User user)
{ {
@ -111,7 +111,7 @@ namespace DamageAssesment.Api.UsersAccess.Controllers
return BadRequest(result.ErrorMessage); return BadRequest(result.ErrorMessage);
} }
// [Authorize(Policy = "DamageApp", Roles = "admin")] [Authorize(Policy = "DamageApp", Roles = "admin")]
[HttpDelete("users/{Id}")] [HttpDelete("users/{Id}")]
public async Task<ActionResult> DeleteUserAsync(int Id) public async Task<ActionResult> DeleteUserAsync(int Id)
{ {