Refactor token handling, support server-initiated pairing

This commit is contained in:
nicolas.dorier
2017-10-11 12:20:44 +09:00
parent 7d8c3c1c81
commit 6d3ea65e03
24 changed files with 985 additions and 228 deletions

View File

@@ -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;
}
}