mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
19 lines
442 B
C#
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;
|
|
}
|
|
}
|
|
}
|