Arc
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
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 |
|
|
|