feat(security): switch master key to non-extractable CryptoKey handle and remove direct access
This commit is contained in:
13
src/app.jsx
13
src/app.jsx
@@ -2589,7 +2589,7 @@
|
||||
}
|
||||
|
||||
// Single QR code - try to decode directly
|
||||
console.log('Processing single QR code:', scannedData.substring(0, 50) + '...');
|
||||
// Removed verbose debug log
|
||||
let parsedData;
|
||||
if (typeof window.decodeAnyPayload === 'function') {
|
||||
const any = window.decodeAnyPayload(scannedData);
|
||||
@@ -2939,26 +2939,15 @@
|
||||
|
||||
let offer;
|
||||
try {
|
||||
console.log('DEBUG: Processing offer input:', offerInput.trim().substring(0, 100) + '...');
|
||||
console.log('DEBUG: decodeAnyPayload available:', typeof window.decodeAnyPayload === 'function');
|
||||
console.log('DEBUG: decompressIfNeeded available:', typeof window.decompressIfNeeded === 'function');
|
||||
|
||||
// Prefer binary decode first, then gzip JSON
|
||||
if (typeof window.decodeAnyPayload === 'function') {
|
||||
console.log('DEBUG: Using decodeAnyPayload...');
|
||||
const any = window.decodeAnyPayload(offerInput.trim());
|
||||
console.log('DEBUG: decodeAnyPayload result type:', typeof any);
|
||||
console.log('DEBUG: decodeAnyPayload result:', any);
|
||||
offer = (typeof any === 'string') ? JSON.parse(any) : any;
|
||||
} else {
|
||||
console.log('DEBUG: Using decompressIfNeeded...');
|
||||
const rawText = (typeof window.decompressIfNeeded === 'function') ? window.decompressIfNeeded(offerInput.trim()) : offerInput.trim();
|
||||
console.log('DEBUG: decompressIfNeeded result:', rawText.substring(0, 100) + '...');
|
||||
offer = JSON.parse(rawText);
|
||||
}
|
||||
console.log('DEBUG: Final offer:', offer);
|
||||
} catch (parseError) {
|
||||
console.error('DEBUG: Parse error:', parseError);
|
||||
throw new Error(`Invalid invitation format: ${parseError.message}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user