Skip to content

Commit

Permalink
Handle prod URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Nov 30, 2024
1 parent 61aa042 commit 0e5eaea
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.request.*
import io.ktor.http.*
import ivy.learn.ServerMode
import ivy.learn.config.ServerConfiguration
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand All @@ -17,6 +18,7 @@ class GoogleOAuthUseCase(
private val config: ServerConfiguration,
private val httpClient: HttpClient,
private val logger: Logger,
private val serverMode: ServerMode,
) {

suspend fun verify(
Expand Down Expand Up @@ -53,7 +55,11 @@ class GoogleOAuthUseCase(
"code" to code.value,
"client_id" to config.googleOAuth.clientId,
"client_secret" to config.googleOAuth.clientSecret,
"redirect_uri" to "http://localhost:8081/auth/google/callback",
"redirect_uri" to if (serverMode.devMode) {
"http://localhost:8081/auth/google/callback"
} else {
"https://api.ivylearn.app/auth/google/callback"
},
"grant_type" to "authorization_code"
)
)
Expand Down

0 comments on commit 0e5eaea

Please sign in to comment.