refactor: update Dockerfile paths, network module auth flow, and Keycloak config

Updated Dockerfiles to fix frontend path references after refactoring. Refactored `networkModule` to replace the `Auth` plugin with manual auth header injection for enhanced logout support. Adjusted Keycloak realm configuration to set default credentials as non-temporary. Improved error handling in `AuthApiClient` with detailed response messages.
This commit is contained in:
2026-01-23 15:42:07 +01:00
parent a3ac6a52be
commit 48ee074dbd
7 changed files with 44 additions and 35 deletions
@@ -4,6 +4,7 @@ import at.mocode.shared.core.AppConstants
import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.request.forms.*
import io.ktor.client.statement.*
import io.ktor.http.*
import kotlinx.serialization.Serializable
@@ -63,9 +64,10 @@ class AuthApiClient(
username = username
)
} else {
val errorBody = response.bodyAsText()
LoginResponse(
success = false,
message = "Login fehlgeschlagen: HTTP ${response.status.value}"
message = "Login fehlgeschlagen: HTTP ${response.status.value} - $errorBody"
)
}
} catch (e: Exception) {
@@ -104,9 +106,10 @@ class AuthApiClient(
message = null
)
} else {
val errorBody = response.bodyAsText()
LoginResponse(
success = false,
message = "Token refresh fehlgeschlagen: HTTP ${response.status.value}"
message = "Token refresh fehlgeschlagen: HTTP ${response.status.value} - $errorBody"
)
}
} catch (e: Exception) {
@@ -15,10 +15,10 @@ val authModule = module {
// Single in-memory token manager
single { AuthTokenManager() }
// AuthApiClient with injected apiClient and DEV client secret
// AuthApiClient with injected baseHttpClient (NOT apiClient)
single {
AuthApiClient(
httpClient = get(named("apiClient")),
httpClient = get(named("baseHttpClient")),
clientSecret = AppConstants.KEYCLOAK_CLIENT_SECRET
)
}
@@ -30,8 +30,7 @@ val authModule = module {
single<TokenProvider> {
object : TokenProvider {
override fun getAccessToken(): String? {
val token = get<AuthTokenManager>().getToken()
return token
return get<AuthTokenManager>().getToken()
}
}
}