btcpayserver/BTCPayServer/Extensions.cs
NicolasDorier b5c6ed3860 Init
2017-09-13 15:55:16 +09:00

19 lines
442 B
C#

using BTCPayServer.Authentication;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;
namespace BTCPayServer
{
public static class Extensions
{
public static BitIdentity GetBitIdentity(this Controller controller)
{
if(!(controller.User.Identity is BitIdentity))
throw new UnauthorizedAccessException("no-bitid");
return (BitIdentity)controller.User.Identity;
}
}
}