retrievePinSecurely method
Retrieve PIN with biometric verification
Implementation
Future<String?> retrievePinSecurely(String username, {bool testMode = false}) async {
try {
OnairosDebugHelper.log('🔓 Retrieving PIN securely');
// Test mode: Generate a mock PIN
if (testMode) {
OnairosDebugHelper.log('✅ Test mode: PIN retrieved');
return 'Test123!';
}
// Retrieve from secure storage with biometric protection
final pin = await _storage.retrievePinSecurely(username: username);
if (pin != null) {
OnairosDebugHelper.log('✅ PIN retrieved successfully');
} else {
OnairosDebugHelper.log('⚠️ No PIN found for user');
}
return pin;
} catch (e) {
OnairosDebugHelper.log('❌ Error retrieving PIN: $e');
return null;
}
}