divan/GanjooRazor/Pages/Auth/Login.cshtml.cs
Hamid Reza Mohammadi 9a93cdd962 refactoring
2026-07-17 08:53:07 +03:30

32 lines
899 B
C#

using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using System.Net.Http;
namespace GanjooRazor.Pages
{
[IgnoreAntiforgeryToken(Order = 1001)]
public class LoginModel : LoginPartialEnabledPageModel
{
public LoginModel(HttpClient httpClient, IConfiguration configuration) : base(httpClient, configuration) { }
public string UserFriendlyName { get; set; }
public string LastError { get; set; }
public string RedirectUrl { get; set; }
public void OnGet()
{
UserFriendlyName = Request.Cookies["Name"];
LoggedIn = !string.IsNullOrEmpty(UserFriendlyName);
LastError = Request.Query["error"];
RedirectUrl = Request.Query["redirect"];
if (string.IsNullOrEmpty(RedirectUrl))
{
RedirectUrl = "/";
}
}
}
}