mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
35 lines
810 B
C#
35 lines
810 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Remotely_Server.Data;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
namespace Remotely_Server.Pages
|
|
{
|
|
public class IndexModel : PageModel
|
|
{
|
|
private DataService DB { get; }
|
|
public IndexModel(DataService db)
|
|
{
|
|
DB = db;
|
|
}
|
|
|
|
public string DefaultPrompt { get; set; }
|
|
public void OnGet()
|
|
{
|
|
if (User?.Identity?.IsAuthenticated == true)
|
|
{
|
|
DefaultPrompt = DB.GetDefaultPrompt(User.Identity.Name);
|
|
|
|
}
|
|
else
|
|
{
|
|
DefaultPrompt = DB.GetDefaultPrompt();
|
|
}
|
|
}
|
|
}
|
|
}
|