fix: add Desktop OAuth timeout, restore iOS keyWindow filter
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package ch.parano.myice.auth
|
||||
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.TimeoutCancellationException
|
||||
import kotlinx.coroutines.withTimeout
|
||||
import java.awt.Desktop
|
||||
import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
@@ -84,7 +86,11 @@ class DesktopOAuthClient : OAuthClient {
|
||||
}
|
||||
|
||||
return try {
|
||||
deferred.await()
|
||||
withTimeout(5 * 60 * 1000L) {
|
||||
deferred.await()
|
||||
}
|
||||
} catch (e: TimeoutCancellationException) {
|
||||
null
|
||||
} finally {
|
||||
server.close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user