Skip to content

Commit

Permalink
Add the actual URL to the authentication calls (#2115)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshokouhi authored Jan 5, 2022
1 parent b409b90 commit 0cb53fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class AuthenticationRepositoryImpl @Inject constructor(
}

override suspend fun initiateLoginFlow(): LoginFlowInit {
val url = urlRepository.getUrl()?.toHttpUrlOrNull().toString()
return authenticationService.initializeLogin(
url + "auth/login_flow",
LoginFlowRequest(
AuthenticationService.CLIENT_ID,
AuthenticationService.AUTH_CALLBACK,
Expand All @@ -42,8 +44,9 @@ class AuthenticationRepositoryImpl @Inject constructor(
}

override suspend fun loginAuthentication(flowId: String, username: String, password: String): LoginFlowCreateEntry {
val url = urlRepository.getUrl()?.toHttpUrlOrNull().toString()
return authenticationService.authenticate(
AuthenticationService.AUTHENTICATE_BASE_PATH + flowId,
url + AuthenticationService.AUTHENTICATE_BASE_PATH + flowId,
LoginFlowAuthentication(
AuthenticationService.CLIENT_ID,
username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ interface AuthenticationService {
@Field("action") action: String
)

@POST("auth/login_flow")
suspend fun initializeLogin(@Body body: LoginFlowRequest): LoginFlowInit
@POST
suspend fun initializeLogin(@Url url: String, @Body body: LoginFlowRequest): LoginFlowInit

@POST
suspend fun authenticate(@Url url: String, @Body body: LoginFlowAuthentication): LoginFlowCreateEntry
Expand Down

0 comments on commit 0cb53fa

Please sign in to comment.