Skip to content

Commit

Permalink
Cleanup code and update endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
TimOrtel committed Jun 13, 2023
1 parent 9a61dc5 commit 9585b4b
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 948 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal class LoginServiceImpl(
return performNetworkCall {
val response = ktorProvider.ktorClient.post(serverUrl) {
url {
appendPathSegments("api", "authenticate")
appendPathSegments("api", "public", "authenticate")
}

contentType(ContentType.Application.Json)
Expand All @@ -48,7 +48,7 @@ internal class LoginServiceImpl(
return performNetworkCall {
ktorProvider.ktorClient.post(serverUrl) {
url {
appendPathSegments("api", "saml2")
appendPathSegments("api", "public", "saml2")
}
setBody(rememberMe)
contentType(ContentType.Application.Json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal class ServerDataServiceImpl(private val ktorProvider: KtorProvider) : S
.ktorClient
.get(serverUrl) {
url {
appendPathSegments("api", "account")
appendPathSegments("api", "public", "account")
}

contentType(ContentType.Application.Json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ interface AccountService {
sealed class AuthenticationData {
object NotLoggedIn : AuthenticationData()

data class LoggedIn(val authToken: String, val username: String) :
AuthenticationData() {
val asBearer = "Bearer $authToken"
}
data class LoggedIn(val authToken: String, val username: String) : AuthenticationData()
}

suspend fun login(username: String, password: String, rememberMe: Boolean): LoginResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ internal class ServerTimeServiceImpl(
performNetworkCall {
ktorProvider.ktorClient.get(serverUrl) {
url {
appendPathSegments("time")
appendPathSegments("api", "public", "time")
}

contentType(ContentType.Application.Json)
Expand Down
Loading

0 comments on commit 9585b4b

Please sign in to comment.