File tree Expand file tree Collapse file tree 4 files changed +28
-19
lines changed
main/kotlin/com/ctrlhub/core
test/kotlin/com/ctrlhub/core/router Expand file tree Collapse file tree 4 files changed +28
-19
lines changed Original file line number Diff line number Diff line change
1
+ package com.ctrlhub.core.api.payload.auth
2
+
3
+ import kotlinx.serialization.Serializable
4
+
5
+ @Serializable
6
+ data class LoginPayload (
7
+ val identifier : String ,
8
+ val password : String ,
9
+ val method : String
10
+ )
Original file line number Diff line number Diff line change
1
+ package com.ctrlhub.core.api.response.auth
2
+
3
+ import kotlinx.serialization.SerialName
4
+ import kotlinx.serialization.Serializable
5
+
6
+ @Serializable
7
+ data class AuthFlowResponse (
8
+ val id : String
9
+ )
10
+
11
+ @Serializable
12
+ data class CompleteResponse (
13
+ @SerialName(" session_token" ) val sessionToken : String
14
+ )
Original file line number Diff line number Diff line change @@ -2,26 +2,10 @@ package com.ctrlhub.core.router
2
2
3
3
import com.ctrlhub.core.api.ApiException
4
4
import com.ctrlhub.core.api.KtorApiClient
5
+ import com.ctrlhub.core.api.payload.auth.LoginPayload
6
+ import com.ctrlhub.core.api.response.auth.AuthFlowResponse
7
+ import com.ctrlhub.core.api.response.auth.CompleteResponse
5
8
import io.ktor.client.call.*
6
- import kotlinx.serialization.SerialName
7
- import kotlinx.serialization.Serializable
8
-
9
- @Serializable
10
- data class LoginPayload (
11
- val identifier : String ,
12
- val password : String ,
13
- val method : String
14
- )
15
-
16
- @Serializable
17
- data class AuthFlowResponse (
18
- val id : String
19
- )
20
-
21
- @Serializable
22
- data class CompleteResponse (
23
- @SerialName(" session_token" ) val sessionToken : String
24
- )
25
9
26
10
class AuthRouter (apiClient : KtorApiClient ) : Router(apiClient) {
27
11
suspend fun initiate (): AuthFlowResponse {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.ctrlhub.core.router
2
2
3
3
import com.ctrlhub.core.api.ApiException
4
4
import com.ctrlhub.core.api.KtorApiClient
5
+ import com.ctrlhub.core.api.payload.auth.LoginPayload
5
6
import io.ktor.client.*
6
7
import io.ktor.client.engine.mock.*
7
8
import io.ktor.http.*
You can’t perform that action at this time.
0 commit comments