mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-13 11:35:51 +01:00
do not throw 500 if using a pairing code which does not exists
This commit is contained in:
parent
0009ed0921
commit
752d34f603
2 changed files with 4 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue