mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Refactor token handling, support server-initiated pairing
This commit is contained in:
@@ -38,10 +38,10 @@ namespace BTCPayServer
|
||||
}
|
||||
|
||||
|
||||
public static BitIdentity GetBitIdentity(this Controller controller)
|
||||
public static BitIdentity GetBitIdentity(this Controller controller, bool throws = true)
|
||||
{
|
||||
if(!(controller.User.Identity is BitIdentity))
|
||||
throw new UnauthorizedAccessException("no-bitid");
|
||||
return throws ? throw new UnauthorizedAccessException("no-bitid") : (BitIdentity)null;
|
||||
return (BitIdentity)controller.User.Identity;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user