chore: entferne AuthApiClient, AuthTokenManager und DeviceInitializationConfig.jvm, da diese nicht mehr benötigt werden
This commit is contained in:
+5
-3
@@ -1,4 +1,6 @@
|
||||
package at.mocode.frontend.core.auth.data
|
||||
package at.mocode.frontend.core.auth.data.local
|
||||
|
||||
import at.mocode.frontend.core.auth.data.remote.AuthApiClient
|
||||
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
@@ -117,7 +119,7 @@ class AuthTokenManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current JWT token
|
||||
* Get the current JWT token
|
||||
*/
|
||||
fun getToken(): String? = currentToken
|
||||
|
||||
@@ -147,7 +149,7 @@ class AuthTokenManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user ID from token
|
||||
* Get user ID from a token
|
||||
*/
|
||||
fun getUserId(): String? = tokenPayload?.sub
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
package at.mocode.frontend.core.auth.data
|
||||
package at.mocode.frontend.core.auth.data.remote
|
||||
|
||||
import at.mocode.frontend.core.auth.utils.PkceHelper
|
||||
|
||||
import at.mocode.frontend.core.domain.AppConstants
|
||||
import at.mocode.frontend.core.network.PlatformConfig
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package at.mocode.frontend.core.auth.di
|
||||
|
||||
import at.mocode.frontend.core.auth.data.AuthApiClient
|
||||
import at.mocode.frontend.core.auth.data.AuthTokenManager
|
||||
import at.mocode.frontend.core.auth.data.remote.AuthApiClient
|
||||
import at.mocode.frontend.core.auth.data.local.AuthTokenManager
|
||||
import at.mocode.frontend.core.auth.presentation.LoginViewModel
|
||||
import at.mocode.frontend.core.domain.AppConstants
|
||||
import at.mocode.frontend.core.network.TokenProvider
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package at.mocode.frontend.core.auth.data
|
||||
package at.mocode.frontend.core.auth.domain.service
|
||||
|
||||
/**
|
||||
* Ergebnis eines OIDC-Callback-Empfangs (Authorization Code + State).
|
||||
+8
-1
@@ -2,7 +2,14 @@ package at.mocode.frontend.core.auth.presentation
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import at.mocode.frontend.core.auth.data.*
|
||||
import at.mocode.frontend.core.auth.data.local.AuthState
|
||||
import at.mocode.frontend.core.auth.data.local.AuthTokenManager
|
||||
import at.mocode.frontend.core.auth.data.remote.AuthApiClient
|
||||
import at.mocode.frontend.core.auth.domain.service.OidcCallbackResult
|
||||
import at.mocode.frontend.core.auth.domain.service.consumePendingOidcCallback
|
||||
import at.mocode.frontend.core.auth.domain.service.getOidcRedirectUri
|
||||
import at.mocode.frontend.core.auth.domain.service.launchOidcFlow
|
||||
import at.mocode.frontend.core.auth.utils.PkceHelper
|
||||
import at.mocode.frontend.core.domain.AppConstants
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package at.mocode.frontend.core.auth.data
|
||||
package at.mocode.frontend.core.auth.utils
|
||||
|
||||
import kotlin.random.Random
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
@file:Suppress("REDUNDANT_CALL_OF_CONVERSION_METHOD")
|
||||
|
||||
package at.mocode.frontend.core.auth.data
|
||||
package at.mocode.frontend.core.auth.utils
|
||||
|
||||
/**
|
||||
* Reines Kotlin SHA-256 nach FIPS 180-4.
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
package at.mocode.frontend.core.auth.data
|
||||
package at.mocode.frontend.core.auth.domain.service
|
||||
|
||||
import com.sun.net.httpserver.HttpServer
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
@@ -8,6 +8,7 @@ import kotlinx.coroutines.withTimeoutOrNull
|
||||
import java.awt.Desktop
|
||||
import java.net.InetSocketAddress
|
||||
import java.net.URI
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
/**
|
||||
* JVM-Implementierung: öffnet den System-Browser und startet einen lokalen
|
||||
@@ -71,7 +72,7 @@ actual suspend fun launchOidcFlow(
|
||||
}
|
||||
|
||||
// Warten auf Callback (max. 5 Minuten)
|
||||
return withTimeoutOrNull(5 * 60 * 1000L) {
|
||||
return withTimeoutOrNull((5 * 60 * 1000L).milliseconds) {
|
||||
deferred.await()
|
||||
} ?: run {
|
||||
server.stop(0)
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package at.mocode.frontend.core.auth.data
|
||||
package at.mocode.frontend.core.auth.domain.service
|
||||
|
||||
/**
|
||||
* Wasm-Implementierung für OIDC Redirect.
|
||||
Reference in New Issue
Block a user