Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ import retrofit2.http.*

interface GitHubAuthApi {

@GET("oauth/github")
@GET("auth/oauth/github")
suspend fun initiateOAuth(@Query("mobile") mobile: Boolean = true): Response<OAuthInitiationResponse>

@POST("oauth/github/callback")
@POST("auth/oauth/github/callback/api")
suspend fun handleCallback(
@Body request: OAuthCallbackDto,
@Query("mobile") mobile: Boolean = true
@Body request: OAuthCallbackDto
): Response<AuthResponseDto>

@POST("refresh")
@POST("auth/refresh")
suspend fun refreshToken(@Body request: RefreshTokenDto): Response<AuthResponseDto>

@POST("logout")
@POST("auth/logout")
suspend fun logout(): Response<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AuthRepositoryImpl @Inject constructor(
return try {
android.util.Log.d("AuthRepository", "Handling OAuth callback - code: ${code.take(10)}..., state: ${state.take(10)}...")
val request = OAuthCallbackDto(code = code, state = state)
val response = remoteDataSource.handleCallback(request, mobile = true)
val response = remoteDataSource.handleCallback(request)

android.util.Log.d("AuthRepository", "Response code: ${response.code()}, isSuccessful: ${response.isSuccessful}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class OAuthCallbackActivity : ComponentActivity() {
navigateToMain()
}
code != null && state != null -> {
Log.d("OAuthCallback", "Received OAuth code, need to exchange for tokens")
Log.d("OAuthCallback", "Received OAuth code, exchanging for tokens via API")
authViewModel.handleEvent(AuthEvent.HandleOAuthCallback(code, state))
finish()
}
Expand Down