Add endpoint to login from mobile
This commit is contained in:
commit
34b4adf0bf
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user