From 9528cecc2770eda0b24d85f45fa5f715b9435f14 Mon Sep 17 00:00:00 2001 From: Davide Date: Tue, 19 Nov 2024 11:46:42 +0100 Subject: [PATCH] Verify profile before presenting interactive login (#893) If the profile is ineligible for features other than .interactiveLogin, the interactive prompt would still be presented, but the user would hit the paywall right afterwards. --- .../Sources/UILibrary/Views/UI/TunnelToggleButton.swift | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Passepartout/Library/Sources/UILibrary/Views/UI/TunnelToggleButton.swift b/Passepartout/Library/Sources/UILibrary/Views/UI/TunnelToggleButton.swift index 73e86b3e..2d455d20 100644 --- a/Passepartout/Library/Sources/UILibrary/Views/UI/TunnelToggleButton.swift +++ b/Passepartout/Library/Sources/UILibrary/Views/UI/TunnelToggleButton.swift @@ -111,16 +111,15 @@ private extension TunnelToggleButton { } } if canConnect && profile.isInteractive { - - // ineligible, suppress interactive login - if !iapManager.isEligible(for: .interactiveLogin) { - pp_log(.app, .notice, "Ineligible, suppress interactive login") - } else { + do { + try iapManager.verify(profile) pp_log(.app, .notice, "Present interactive login") interactiveManager.present(with: profile) { await perform(with: $0) } return + } catch { + pp_log(.app, .notice, "Ineligible, suppress interactive login") } } await perform(with: profile)