From 22cbf3d42ecf3892073247dbc6d45d6f5385c667 Mon Sep 17 00:00:00 2001 From: thug0bin Date: Wed, 25 Feb 2026 13:32:25 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B8=B0=EC=A1=B4=20QR=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EA=B1=B0=EB=9E=98=EB=8F=84=20=ED=82=A4=EC=98=A4?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EC=97=90=EC=84=9C=20QR=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 기존 토큰의 nonce를 복원할 수 없는 문제 해결 - verify_claim_token이 transaction_id로만 검증하므로 새 nonce로 QR URL 생성 Co-Authored-By: Claude Opus 4.6 --- backend/app.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/app.py b/backend/app.py index 6a4c53a..a27c563 100644 --- a/backend/app.py +++ b/backend/app.py @@ -1888,13 +1888,12 @@ def api_kiosk_trigger(): return jsonify({'success': False, 'message': '이미 적립된 거래입니다.'}), 400 if token_row: - # 기존 토큰 사용 + # 기존 토큰 사용 — QR URL은 새 nonce로 생성 + # (verify_claim_token은 transaction_id로만 조회하므로 nonce 불일치 무관) claimable_points = token_row['claimable_points'] - # nonce 재생성 (기존 토큰의 hash에서 nonce를 알 수 없으므로 QR URL 재생성) + nonce = secrets.token_hex(6) from utils.qr_token_generator import QR_BASE_URL - # 기존 토큰의 nonce를 DB에서 가져올 수 없으므로, 새 nonce로 QR 재생성은 불가 - # → 키오스크에서는 QR 대신 transaction_id + nonce를 직접 제공 - qr_url = None + qr_url = f"{QR_BASE_URL}?t={transaction_id}:{nonce}" else: # 새 토큰 생성 from utils.qr_token_generator import generate_claim_token, save_token_to_db