using System.Linq;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.RazorPages;
using trainav.web.database;
using trainav.web.database.Tables;
using trainav.web.Utils;

namespace trainav.web.Pages;

public class IndexModel : PageModel {
	public User AuthorizedUser;

	public void OnGet() {
		using var db  = new Database.DbConn();
		AuthorizedUser = db.Users.FirstOrDefault(p => p.Username == AuthUtil.GetRemoteUser(HttpContext, db));
	}
}
