Browse Source

Update decorators.py

fee_issues
Arc 5 years ago
committed by GitHub
parent
commit
764fde012c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lnbits/decorators.py

4
lnbits/decorators.py

@ -13,9 +13,9 @@ def api_check_wallet_macaroon(*, key_type: str = "invoice"):
@wraps(view)
def wrapped_view(**kwargs):
try:
g.wallet = get_wallet_for_key(request.headers["Grpc-Metadata-macaroon"], key_type)
g.wallet = get_wallet_for_key(request.headers["api_key"], key_type)
except KeyError:
return jsonify({"message": "`Grpc-Metadata-macaroon` header missing."}), Status.BAD_REQUEST
return jsonify({"message": "`api_key` header missing."}), Status.BAD_REQUEST
if not g.wallet:
return jsonify({"message": "Wrong keys."}), Status.UNAUTHORIZED

Loading…
Cancel
Save