Skip to content

Commit

Permalink
Fix HTTPS (#591)
Browse files Browse the repository at this point in the history
Co-authored-by: hfhbd <[email protected]>
  • Loading branch information
hfhbd and hfhbd authored Jul 27, 2022
1 parent 1f8d0d9 commit efb0297
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ dependencies {
implementation("io.ktor:ktor-server-resources:$ktor")
implementation("io.ktor:ktor-server-content-negotiation:$ktor")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor")
implementation("io.ktor:ktor-server-forwarded-header:$ktor")

// Apache 2, https://github.com/hfhbd/cloudkitclient/releases/latest
implementation("app.softwork:cloudkitclient-core:0.1.0")
Expand Down
2 changes: 2 additions & 0 deletions backend/src/main/kotlin/app/softwork/composetodo/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import io.ktor.server.application.*
import io.ktor.server.cio.*
import io.ktor.server.engine.*
import io.ktor.server.plugins.cors.routing.*
import io.ktor.server.plugins.forwardedheaders.*
import org.slf4j.*
import java.util.*
import kotlin.reflect.*
Expand All @@ -31,6 +32,7 @@ fun main() {
allowMethod(HttpMethod.Delete)
allowMethod(HttpMethod.Put)
}
install(XForwardedHeaders)
TodoModule(db = db, jwtProvider = jwtProvider)
}.start(wait = true)
}
Expand Down
4 changes: 2 additions & 2 deletions clients/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kotlin {
export(projects.shared)
export("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
export("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
export("app.softwork:kotlinx-uuid-core:0.0.15")
export("app.softwork:kotlinx-uuid-core:0.0.16-sqldelight2a03")
embedBitcode = BitcodeEmbeddingMode.DISABLE
}
}
Expand All @@ -51,7 +51,7 @@ kotlin {
dependencies {
api(projects.shared)
implementation("app.cash.sqldelight:coroutines-extensions:$sqlDelight")
implementation("app.softwork:kotlinx-uuid-sqldelight:0.0.15")
implementation("app.softwork:kotlinx-uuid-sqldelight:0.0.16-sqldelight2a03")

api("io.ktor:ktor-client-logging:$ktor")
}
Expand Down
2 changes: 1 addition & 1 deletion shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kotlin {
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")

// Apache 2, https://github.com/hfhbd/kotlinx-uuid/releases
api("app.softwork:kotlinx-uuid-core:0.0.15")
api("app.softwork:kotlinx-uuid-core:0.0.16-sqldelight2a03")

// Apache 2, https://github.com/ktorio/ktor/releases/latest
val ktor = "2.0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public sealed interface API {
@Throws(IOException::class, CancellationException::class)
public suspend fun silentLogin(): LoggedIn? {
val response = client.get(RefreshToken())
return if (response.status == HttpStatusCode.BadRequest) {
return if (response.status == HttpStatusCode.BadRequest || response.status == HttpStatusCode.Unauthorized) {
null
} else {
LoggedIn(response.body(), client)
Expand Down

0 comments on commit efb0297

Please sign in to comment.