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

View File

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