Skip to content

Commit 9a8b6bf

Browse files
Remove hostUrl (#602)
* Remove hostUrl * Remove IST error print statements --------- Co-authored-by: Jordan Haven <117691317+jhaven-stytch@users.noreply.github.com>
1 parent 64c42d6 commit 9a8b6bf

File tree

5 files changed

+4
-25
lines changed

5 files changed

+4
-25
lines changed

Sources/StytchCore/SessionManager.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ extension SessionManager {
177177
return nil
178178
}
179179
} catch {
180-
print("Error getting IST: \(error)")
181180
return nil
182181
}
183182
}
@@ -189,7 +188,7 @@ extension SessionManager {
189188
removeIntermediateSessionToken()
190189
}
191190
} catch {
192-
print("Error setting IST: \(error)")
191+
// Do Nothing
193192
}
194193
}
195194
}

Sources/StytchCore/SharedModels/Errors/StytchSDKError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public class StytchSDKNotConfiguredError: StytchSDKError {
173173
init(clientName: String) {
174174
self.clientName = clientName
175175
super.init(
176-
message: "\(clientName) not yet configured. Must include a `StytchConfiguration.plist` in your main bundle or call `\(clientName).configure(publicToken:hostUrl:)` prior to other \(clientName) calls.",
176+
message: "\(clientName) not yet configured. Must include a `StytchConfiguration.plist` in your main bundle or call `\(clientName).configure(publicToken:)` prior to other \(clientName) calls.",
177177
options: .init(
178178
errorType: "sdk_not_configured",
179179
url: .readmeUrl(withFragment: "configuration")

Sources/StytchCore/SharedModels/StytchClientConfiguration.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ public struct StytchClientConfiguration: Equatable, Codable {
77
case publicToken = "StytchPublicToken"
88
case defaultSessionDuration
99
case enableAutomaticSessionExtension
10-
case hostUrl = "StytchHostURL"
1110
case dfppaDomain = "StytchDfppaDomain"
1211
case testDomain = "StytchTestDomain"
1312
case liveDomain = "StytchLiveDomain"
@@ -16,7 +15,6 @@ public struct StytchClientConfiguration: Equatable, Codable {
1615
public let publicToken: String
1716
public let defaultSessionDuration: Minutes
1817
public let enableAutomaticSessionExtension: Bool
19-
public let hostUrl: URL?
2018
public let dfppaDomain: String?
2119
public let testDomain: String
2220
public let liveDomain: String
@@ -28,9 +26,6 @@ public struct StytchClientConfiguration: Equatable, Codable {
2826
- defaultSessionDuration: The default session length in minutes, must be less than or equal to the value set in the Stytch Dashboard (Frontend SDKs > Session duration).
2927
Applies to all authentication calls unless explicitly overridden, defaults to 5 minutes.
3028
- enableAutomaticSessionExtension: If true, the session heartbeat will attempt to extend the session duration instead of only checking the validity.
31-
- hostUrl: Generally this is your backend's base url, where your apple-app-site-association file is hosted.
32-
This is an https url which will be used as the domain for setting session-token cookies to be sent to your servers on subsequent requests.
33-
If not passed here, no cookies will be set on your behalf.
3429
- dfppaDomain: The domain that should be used for DFPPA
3530
- testDomain: The custom domain to use for Stytch API calls for test projects
3631
- liveDomain: The custom domain to use for Stytch API calls for live projects
@@ -39,15 +34,13 @@ public struct StytchClientConfiguration: Equatable, Codable {
3934
publicToken: String,
4035
defaultSessionDuration: Minutes = 5,
4136
enableAutomaticSessionExtension: Bool = false,
42-
hostUrl: URL? = nil,
4337
dfppaDomain: String? = nil,
4438
testDomain: String = "test.stytch.com",
4539
liveDomain: String = "api.stytch.com"
4640
) {
4741
self.publicToken = publicToken
4842
self.defaultSessionDuration = defaultSessionDuration
4943
self.enableAutomaticSessionExtension = enableAutomaticSessionExtension
50-
self.hostUrl = hostUrl
5144
self.dfppaDomain = dfppaDomain
5245
self.testDomain = testDomain
5346
self.liveDomain = liveDomain
@@ -80,17 +73,5 @@ public extension StytchClientConfiguration {
8073
dfppaDomain = try container.decode(key: .dfppaDomain)
8174
testDomain = try container.decode(key: .testDomain)
8275
liveDomain = try container.decode(key: .liveDomain)
83-
do {
84-
hostUrl = try container.decode(key: .hostUrl)
85-
} catch {
86-
guard let urlString: String = try? container.decode(key: .hostUrl) else {
87-
hostUrl = nil
88-
return
89-
}
90-
guard let url = URL(string: urlString) else {
91-
throw DecodingError.dataCorruptedError(forKey: .hostUrl, in: container, debugDescription: "Not a valid hostUrl URL")
92-
}
93-
hostUrl = url
94-
}
9576
}
9677
}

Tests/StytchCoreTests/BaseTestCase.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ class BaseTestCase: XCTestCase {
3838

3939
StytchClient.configure(configuration: .init(
4040
publicToken: "xyz",
41-
defaultSessionDuration: 5,
42-
hostUrl: try XCTUnwrap(URL(string: "https://myapp.com"))
41+
defaultSessionDuration: 5
4342
))
4443

4544
networkInterceptor.reset()

Tests/StytchCoreTests/StytchClientTestCase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ final class StytchClientTestCase: BaseTestCase {
55
func testGet() async throws {
66
networkInterceptor.responses { "Hello, World!" }
77
// Configure the client after setting the networking client, so the headers are passed to the request
8-
StytchClient.configure(configuration: .init(publicToken: "xyz", defaultSessionDuration: 5, hostUrl: try XCTUnwrap(URL(string: "https://myapp.com"))))
8+
StytchClient.configure(configuration: .init(publicToken: "xyz", defaultSessionDuration: 5))
99
let response: String? = try await StytchClient.router.get(route: .sessions(.authenticate))
1010

1111
try XCTAssertRequest(networkInterceptor.requests[0], urlString: "https://api.stytch.com/sdk/v1/sessions/authenticate", method: .get, headers: [

0 commit comments

Comments
 (0)