diff --git a/Auth0/AuthenticationError.swift b/Auth0/AuthenticationError.swift index faa2c235..66b24c15 100644 --- a/Auth0/AuthenticationError.swift +++ b/Auth0/AuthenticationError.swift @@ -154,6 +154,7 @@ public struct AuthenticationError: Auth0APIError { } let networkErrorCodes: [URLError.Code] = [ + .dataNotAllowed, .notConnectedToInternet, .networkConnectionLost, .dnsLookupFailed, @@ -183,7 +184,7 @@ extension AuthenticationError { return "Received error with code \(self.code)." } - + } // MARK: - Equatable diff --git a/Auth0Tests/AuthenticationErrorSpec.swift b/Auth0Tests/AuthenticationErrorSpec.swift index 95c45ae2..e5e92845 100644 --- a/Auth0Tests/AuthenticationErrorSpec.swift +++ b/Auth0Tests/AuthenticationErrorSpec.swift @@ -420,6 +420,7 @@ class AuthenticationErrorSpec: QuickSpec { it("should detect network error") { let networkErrorCodes: [URLError.Code] = [ + .dataNotAllowed, .notConnectedToInternet, .networkConnectionLost, .dnsLookupFailed, diff --git a/Auth0Tests/WebAuthSpec.swift b/Auth0Tests/WebAuthSpec.swift index 1b51dfc0..cfe8f094 100644 --- a/Auth0Tests/WebAuthSpec.swift +++ b/Auth0Tests/WebAuthSpec.swift @@ -310,20 +310,20 @@ class WebAuthSpec: QuickSpec { if #available(iOS 17.4, macOS 14.4, *) { context("https") { it("should build with the domain") { - expect(newWebAuth().redirectURL?.absoluteString) == "https://\(Domain)/\(platform)/\(bundleId)/callback" + expect(newWebAuth().useHTTPS().redirectURL?.absoluteString) == "https://\(Domain)/\(platform)/\(bundleId)/callback" } it("should build with the domain and a subpath") { let subpath = "foo" let uri = "https://\(Domain)/\(subpath)/\(platform)/\(bundleId)/callback" - let webAuth = Auth0WebAuth(clientId: ClientId, url: DomainURL.appendingPathComponent(subpath)) + let webAuth = Auth0WebAuth(clientId: ClientId, url: DomainURL.appendingPathComponent(subpath)).useHTTPS() expect(webAuth.redirectURL?.absoluteString) == uri } it("should build with the domain and subpaths") { let subpaths = "foo/bar" let uri = "https://\(Domain)/\(subpaths)/\(platform)/\(bundleId)/callback" - let webAuth = Auth0WebAuth(clientId: ClientId, url: DomainURL.appendingPathComponent(subpaths)) + let webAuth = Auth0WebAuth(clientId: ClientId, url: DomainURL.appendingPathComponent(subpaths)).useHTTPS() expect(webAuth.redirectURL?.absoluteString) == uri } }