feat(users): confirm email from admin page
This commit is contained in:
1 parent
02082e504d
commit
1107aa6170
8 files changed
+156
-10
No files matched your search
@@ -219,7 +219,10 @@ public class UsersController : ControllerBase
|
||||
[ProducesResponseType(typeof(void), StatusCodes.Status400BadRequest)]
|
||||
public async Task<IActionResult> ConfirmEmail(Guid id, CancellationToken ct)
|
||||
{
|
||||
var result = await _mediator.Send(new ConfirmEmailCommand(id), ct);
|
||||
if (!this.TryGetUserId(out var actorId))
|
||||
return Unauthorized();
|
||||
|
||||
var result = await _mediator.Send(new ConfirmEmailCommand(id, actorId), ct);
|
||||
return result.IsSuccess
|
||||
? Ok()
|
||||
: StatusCode(result.StatusCode ?? 400, new { error = result.Error });
|
||||
|
||||
Reference in new issue
Block a user