Skip to content

Commit ca78373

Browse files
committed
fix: add support for clearing session token
1 parent f395e74 commit ca78373

File tree

1 file changed

+9
-1
lines changed
  • src/main/kotlin/com/ctrlhub/core

1 file changed

+9
-1
lines changed

src/main/kotlin/com/ctrlhub/core/Api.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ class Api(
1717
fun applySessionToken(sessionToken: String) {
1818
httpClient = KtorClientFactory.create(httpClient) {
1919
defaultRequest {
20-
headers.append("X-Session-Token", sessionToken)
20+
headers["X-Session-Token"] = sessionToken
21+
}
22+
}
23+
}
24+
25+
fun clearSessionToken() {
26+
httpClient = KtorClientFactory.create(httpClient) {
27+
defaultRequest {
28+
headers.remove("X-Session-Token")
2129
}
2230
}
2331
}

0 commit comments

Comments
 (0)