From e63c4c9fa29e8d286ff7b56273bdf01a0ea14d74 Mon Sep 17 00:00:00 2001 From: dni Date: Tue, 26 Jul 2022 12:07:16 +0200 Subject: [PATCH] revert self.wallet change --- lnbits/decorators.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lnbits/decorators.py b/lnbits/decorators.py index e95e53f16..3a67e9439 100644 --- a/lnbits/decorators.py +++ b/lnbits/decorators.py @@ -53,13 +53,12 @@ class KeyChecker(SecurityBase): # FIXME: Find another way to validate the key. A fetch from DB should be avoided here. # Also, we should not return the wallet here - thats silly. # Possibly store it in a Redis DB - wallet = await get_wallet_for_key(key_value, self._key_type) - if not wallet: + self.wallet = await get_wallet_for_key(key_value, self._key_type) + if not self.wallet: raise HTTPException( status_code=HTTPStatus.UNAUTHORIZED, detail="Invalid key or expired key.", ) - self.wallet = wallet except KeyError: raise HTTPException(