From cde8e71d16254270fa3c5ce7defd56961a469df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hochstein?= Date: Mon, 13 Nov 2023 15:28:26 +0100 Subject: [PATCH] Adjust Regex to match trailing appliance-mfa in private envs --- GuardianAppSwiftUI/ContentView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GuardianAppSwiftUI/ContentView.swift b/GuardianAppSwiftUI/ContentView.swift index 9d31af6..fdcb133 100644 --- a/GuardianAppSwiftUI/ContentView.swift +++ b/GuardianAppSwiftUI/ContentView.swift @@ -167,7 +167,7 @@ struct ContentView: View { func extractEmailAndDomain(from urlString: String) -> (email: String?, domain: String?) { let percentEncodingRemoved = urlString.removingPercentEncoding! - let pattern = "otpauth://totp/.+?:(.+?)\\?enrollment_tx_id=.+?&base_url=https?://([^/]+).*" + let pattern = "otpauth://totp/.+?:(.+?)\\?enrollment_tx_id=.+?&base_url=https?://([^/]+.*)" let regex = try! NSRegularExpression(pattern: pattern, options: []) let range = NSRange(location: 0, length: percentEncodingRemoved.count) guard let match = regex.firstMatch(in: percentEncodingRemoved, options: [], range: range) else {