fix: 기존 QR 토큰 거래도 키오스크에서 QR 코드 표시
- 기존 토큰의 nonce를 복원할 수 없는 문제 해결 - verify_claim_token이 transaction_id로만 검증하므로 새 nonce로 QR URL 생성 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a4410f5fe0
commit
22cbf3d42e
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user