mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-05 22:34:25 +01:00
do not throw 500 if using a pairing code which does not exists
This commit is contained in:
@@ -167,6 +167,8 @@ namespace BTCPayServer.Authentication
|
||||
|
||||
private PairingCodeEntity CreatePairingCodeEntity(PairingCodeData data)
|
||||
{
|
||||
if(data == null)
|
||||
return null;
|
||||
return new PairingCodeEntity()
|
||||
{
|
||||
Facade = data.Facade,
|
||||
|
||||
@@ -56,6 +56,8 @@ namespace BTCPayServer.Controllers
|
||||
throw new BitpayHttpException(400, "'id' property is required, alternatively, use BitId");
|
||||
|
||||
pairingEntity = await _TokenRepository.GetPairingAsync(request.PairingCode);
|
||||
if(pairingEntity == null)
|
||||
throw new BitpayHttpException(404, "The specified pairingCode is not found");
|
||||
pairingEntity.SIN = sin;
|
||||
|
||||
if(string.IsNullOrEmpty(pairingEntity.Label) && !string.IsNullOrEmpty(request.Label))
|
||||
|
||||
Reference in New Issue
Block a user