Challenge retrieve api

This commit is contained in:
2025-06-18 01:26:34 +08:00
parent 2a5926a94a
commit ca2d37eb39
4 changed files with 16 additions and 4 deletions

View File

@ -74,6 +74,19 @@ public class AuthController(
return challenge;
}
[HttpGet("challenge/{id:guid}")]
public async Task<ActionResult<Challenge>> GetChallenge([FromRoute] Guid id)
{
var challenge = await db.AuthChallenges
.Include(e => e.Account)
.ThenInclude(e => e.Profile)
.FirstOrDefaultAsync(e => e.Id == id);
return challenge is null
? NotFound("Auth challenge was not found.")
: challenge;
}
[HttpGet("challenge/{id:guid}/factors")]
public async Task<ActionResult<List<AccountAuthFactor>>> GetChallengeFactors([FromRoute] Guid id)
{