diff --git a/apps/swift-ios/App/Cloud/T3ConnectAuth.swift b/apps/swift-ios/App/Cloud/T3ConnectAuth.swift index c4a715e596..dd39facfb8 100644 --- a/apps/swift-ios/App/Cloud/T3ConnectAuth.swift +++ b/apps/swift-ios/App/Cloud/T3ConnectAuth.swift @@ -39,6 +39,11 @@ public enum T3ConnectAuthError: LocalizedError, Sendable { } } +enum T3ConnectAuthCallback { + static let scheme = PlatformRoute.nativeScheme + static let redirectURL = "\(scheme)://clerk-callback" +} + /// Small ClerkKit boundary. Clerk owns encrypted session persistence and the /// ASWebAuthenticationSession callback; the app only asks for the relay JWT. @MainActor @@ -52,8 +57,8 @@ public final class T3ConnectClerkSession { publishableKey: configuration.clerkPublishableKey, options: .init( redirectConfig: .init( - redirectUrl: "t3code://clerk-callback", - callbackUrlScheme: "t3code" + redirectUrl: T3ConnectAuthCallback.redirectURL, + callbackUrlScheme: T3ConnectAuthCallback.scheme ) ) ) diff --git a/apps/swift-ios/T3Code.xcodeproj/project.pbxproj b/apps/swift-ios/T3Code.xcodeproj/project.pbxproj index 52d1b8434e..beb6937f24 100644 --- a/apps/swift-ios/T3Code.xcodeproj/project.pbxproj +++ b/apps/swift-ios/T3Code.xcodeproj/project.pbxproj @@ -603,11 +603,11 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Extensions/Shared/T3Code.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Resources/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = "T3 Code (SwiftUI Dev)"; + INFOPLIST_KEY_CFBundleDisplayName = "T3 Code Dev"; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; INFOPLIST_KEY_NSAppTransportSecurity_NSAllowsArbitraryLoads = YES; @@ -648,10 +648,10 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Extensions/Shared/T3Code.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Resources/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = "T3 Code (SwiftUI)"; + INFOPLIST_KEY_CFBundleDisplayName = "T3 Code Swift"; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; INFOPLIST_KEY_NSAppTransportSecurity_NSAllowsArbitraryLoads = YES; @@ -726,7 +726,7 @@ APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_ENTITLEMENTS = Extensions/Widgets/T3CodeWidgets.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Extensions/Widgets/Info.plist; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; @@ -757,7 +757,7 @@ APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_ENTITLEMENTS = Extensions/Widgets/T3CodeWidgets.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Extensions/Widgets/Info.plist; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; @@ -790,7 +790,7 @@ APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_ENTITLEMENTS = Extensions/Share/T3CodeShare.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Extensions/Share/Info.plist; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; @@ -821,7 +821,7 @@ APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_ENTITLEMENTS = Extensions/Share/T3CodeShare.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Extensions/Share/Info.plist; INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO; diff --git a/apps/swift-ios/Tests/PlatformTests/PlatformDeepLinkTests.swift b/apps/swift-ios/Tests/PlatformTests/PlatformDeepLinkTests.swift index 20def4d9da..7aad550bf3 100644 --- a/apps/swift-ios/Tests/PlatformTests/PlatformDeepLinkTests.swift +++ b/apps/swift-ios/Tests/PlatformTests/PlatformDeepLinkTests.swift @@ -101,6 +101,15 @@ struct PlatformDeepLinkTests { ) } + @Test + func clerkCallbackUsesCurrentAppIdentity() { + #expect(T3ConnectAuthCallback.scheme == PlatformRoute.nativeScheme) + #expect( + T3ConnectAuthCallback.redirectURL + == "\(PlatformRoute.nativeScheme)://clerk-callback" + ) + } + @Test func mailboxConsumesExactlyOnce() throws { let suiteName = "PlatformDeepLinkTests.\(UUID().uuidString)"