Skip to content

Commit 7a690b0

Browse files
authored
Merge pull request #1005 from supabase-community/fix-desktop-implicit
Fix IMPLICIT OAuth flow on Desktop targets
2 parents 14c4d40 + 8d8a384 commit 7a690b0

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Auth/src/desktopMain/kotlin/io/github/jan/supabase/auth/server/HttpCallbackRoutes.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@ internal fun Routing.configureRoutes(
2727
}
2828
shutdown(call, auth.config.httpCallbackConfig.redirectHtml)
2929
} else {
30-
Auth.logger.d {
31-
"No code or error in OAuth callback"
32-
}
33-
call.respondText(
34-
text = "No code or error in OAuth callback",
35-
contentType = ContentType.Text.Html,
36-
status = HttpStatusCode.BadRequest
37-
)
30+
call.respondText(ContentType.Text.Html, HttpStatusCode.OK) { HttpCallbackHtml.landingPage(auth.config.httpCallbackConfig.htmlTitle) }
3831
}
3932
}
4033
get("/callback") {

Auth/src/desktopMain/kotlin/io/github/jan/supabase/auth/server/HttpCallbackServer.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import io.ktor.server.cio.CIO
1212
import io.ktor.server.engine.embeddedServer
1313
import io.ktor.server.response.respondText
1414
import io.ktor.server.routing.routing
15+
import io.ktor.utils.io.InternalAPI
1516
import kotlinx.coroutines.CompletableDeferred
1617
import kotlinx.coroutines.coroutineScope
1718
import kotlinx.coroutines.delay
@@ -74,6 +75,7 @@ internal suspend fun createServer(
7475
}
7576
}
7677

78+
@OptIn(InternalAPI::class)
7779
internal suspend fun shutdown(call: ApplicationCall, message: String) {
7880
val application = call.application
7981
val environment = application.environment
@@ -82,7 +84,7 @@ internal suspend fun shutdown(call: ApplicationCall, message: String) {
8284
call.application.launch {
8385
application.monitor.raise(ApplicationStopPreparing, environment)
8486
latch.join()
85-
application.dispose()
87+
application.disposeAndJoin()
8688
}
8789

8890
try {

0 commit comments

Comments
 (0)