@@ -476,6 +476,17 @@ extension MigrationsService {
476476 try Keychain . saveString ( key: . securityPin, str: pin)
477477 }
478478
479+ private func clearPinSettings( ) {
480+ try ? Keychain . delete ( key: . securityPin)
481+
482+ UserDefaults . standard. removeObject ( forKey: " requirePinForPayments " )
483+ UserDefaults . standard. removeObject ( forKey: " useBiometrics " )
484+ UserDefaults . standard. removeObject ( forKey: " pinFailedAttempts " )
485+ UserDefaults . standard. removeObject ( forKey: " pinOnLaunch " )
486+ UserDefaults . standard. removeObject ( forKey: " pinOnIdle " )
487+ UserDefaults . standard. removeObject ( forKey: " pin " )
488+ }
489+
479490 private func migrateLdkData( ) async throws {
480491 let accountPath = rnLdkAccountPath
481492 let managerPath = accountPath. appendingPathComponent ( " channel_manager.bin " )
@@ -757,6 +768,12 @@ extension MigrationsService {
757768 if let useBiometrics = settings. biometrics {
758769 defaults. set ( useBiometrics, forKey: " useBiometrics " )
759770 }
771+ if let pinOnLaunch = settings. pinOnLaunch {
772+ defaults. set ( pinOnLaunch, forKey: " pinOnLaunch " )
773+ }
774+ if let pinOnIdle = settings. pinOnIdle {
775+ defaults. set ( pinOnIdle, forKey: " pinOnIdle " )
776+ }
760777 if let seen = settings. quickpayIntroSeen {
761778 defaults. set ( seen, forKey: " hasSeenQuickpayIntro " )
762779 }
@@ -1228,6 +1245,8 @@ extension MigrationsService {
12281245 isRestoringFromRNRemoteBackup = true
12291246 Logger . info ( " Starting RN remote backup restore " , context: " Migration " )
12301247
1248+ clearPinSettings ( )
1249+
12311250 // Fetch LDK data (channel_manager and channel_monitors)
12321251 await fetchRNRemoteLdkData ( )
12331252
@@ -1324,7 +1343,12 @@ extension MigrationsService {
13241343 return
13251344 }
13261345
1327- applyRNSettings ( json. data)
1346+ var settings = json. data
1347+ settings. pinForPayments = nil
1348+ settings. biometrics = nil
1349+ settings. pinOnLaunch = nil
1350+ settings. pinOnIdle = nil
1351+ applyRNSettings ( settings)
13281352 }
13291353
13301354 private func applyRNRemoteWidgets( _ data: Data) async throws {
0 commit comments