mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
22 lines
606 B
C#
22 lines
606 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Remotely.Server.Services;
|
|
using Remotely.Shared.Extensions;
|
|
using Remotely.Shared.Models;
|
|
|
|
namespace Remotely.Server.Components
|
|
{
|
|
public class AuthComponentBase : ComponentBase
|
|
{
|
|
public bool IsAuthenticated => AuthService?.IsAuthenticated ?? false;
|
|
|
|
public RemotelyUser User => AuthService?.User;
|
|
|
|
public string Username => AuthService?.Principal?.Identity?.Name;
|
|
|
|
[Inject]
|
|
protected IAuthService AuthService { get; set; }
|
|
}
|
|
}
|