1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2025-08-18 18:24:56 +02:00
Files
.config
.run
.workdir
Agent
Common
Controller
Docker
Utils
Web
Phantom.Web
Phantom.Web.Bootstrap
Phantom.Web.Components
Phantom.Web.Services
Agents
Authentication
AuthenticatedUser.cs
AuthenticationStateExtensions.cs
CustomAuthenticationStateProvider.cs
CustomClaimsPrincipal.cs
UserLoginManager.cs
UserSessionBrowserStorage.cs
UserSessionRefreshManager.cs
Authorization
Events
Instances
Rpc
Users
ApplicationProperties.cs
Navigation.cs
Phantom.Web.Services.csproj
PhantomWebServices.cs
.dockerignore
.gitattributes
.gitignore
AddMigration.bat
AddMigration.sh
Directory.Build.props
Directory.Build.targets
Dockerfile
LICENSE
Packages.props
PhantomPanel.sln
README.md
global.json

19 lines
538 B
C#

using System.Security.Claims;
using Phantom.Common.Data.Web.Users;
namespace Phantom.Web.Services.Authentication;
sealed class CustomClaimsPrincipal : ClaimsPrincipal {
internal AuthenticatedUser User { get; }
internal CustomClaimsPrincipal(AuthenticatedUser user) : base(GetIdentity(user.Info)) {
User = user;
}
private static ClaimsIdentity GetIdentity(AuthenticatedUserInfo userInfo) {
var identity = new ClaimsIdentity("Phantom");
identity.AddClaim(new Claim(ClaimTypes.Name, userInfo.Name));
return identity;
}
}