2024-02-25 17:21:29 +00:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
2024-03-02 00:43:56 +00:00
|
|
|
using OliverBooth.Common.Services;
|
2024-02-25 17:21:29 +00:00
|
|
|
|
|
|
|
namespace OliverBooth.Pages.Admin;
|
|
|
|
|
|
|
|
public class MultiFactorStep : PageModel
|
|
|
|
{
|
|
|
|
private readonly ISessionService _sessionService;
|
|
|
|
|
|
|
|
public MultiFactorStep(ISessionService sessionService)
|
|
|
|
{
|
|
|
|
_sessionService = sessionService;
|
|
|
|
}
|
|
|
|
|
|
|
|
public string Token { get; private set; } = string.Empty;
|
|
|
|
|
|
|
|
public int? Result { get; private set; }
|
|
|
|
|
|
|
|
public IActionResult OnGet([FromQuery(Name = "token")] string token,
|
|
|
|
[FromQuery(Name = "result")] int? result = null)
|
|
|
|
{
|
|
|
|
Token = token;
|
|
|
|
Result = result;
|
|
|
|
return _sessionService.TryGetCurrentUser(Request, Response, out _) ? RedirectToPage("/admin/index") : Page();
|
|
|
|
}
|
|
|
|
}
|