fix(auth): correct typos, add suppression, and improve documentation clarity
- Fixed minor typos in comments for `LoginViewModel`, `OidcCallback`, and `AuthApiClient`.
- Added `@Suppress("REDUNDANT_CALL_OF_CONVERSION_METHOD")` in `Sha256.kt`.
- Improved phrasing and readability of function documentation across files.
Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ class AuthApiClient(
|
||||
) {
|
||||
|
||||
/**
|
||||
* Authenticate user with username and password
|
||||
* Authenticate a user with a username and password
|
||||
*/
|
||||
suspend fun login(username: String, password: String): LoginResponse {
|
||||
val tokenEndpoint = "$keycloakBaseUrl/realms/$realm/protocol/openid-connect/token"
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ expect suspend fun launchOidcFlow(
|
||||
|
||||
/**
|
||||
* Prüft beim App-Start, ob in der aktuellen URL ein OIDC-Callback steckt.
|
||||
* Relevant für JS/Browser: nach Keycloak-Redirect enthält die URL code= und state=.
|
||||
* Gibt null zurück, wenn kein Callback vorhanden.
|
||||
* Relevant für JS/Browser: Nach Keycloak-Redirect enthält die URL code= und state=.
|
||||
* Gibt null zurück, wenn kein Callback vorhanden ist.
|
||||
*/
|
||||
expect fun consumePendingOidcCallback(): OidcCallbackResult?
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("REDUNDANT_CALL_OF_CONVERSION_METHOD")
|
||||
|
||||
package at.mocode.frontend.core.auth.data
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -127,7 +127,7 @@ class LoginViewModel(
|
||||
/**
|
||||
* Startet den OIDC Authorization Code Flow mit PKCE für frontend-client.
|
||||
* JVM: öffnet Browser + wartet auf Callback.
|
||||
* JS: leitet die Seite zu Keycloak weiter (kehrt nicht zurück).
|
||||
* JS: leitet die Seite zu Keycloak weiter (kehrt nicht zurück).
|
||||
*/
|
||||
fun startOidcFlow() {
|
||||
if (_uiState.value.isOidcLoading) return
|
||||
@@ -160,7 +160,7 @@ class LoginViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
/** Verarbeitet das Ergebnis des OIDC-Callbacks (intern + von JS-Startup). */
|
||||
/** Verarbeitet das Ergebnis des OIDC-Callbacks (intern + von JS-Start-up). */
|
||||
private suspend fun handleOidcCallbackResult(result: OidcCallbackResult) {
|
||||
when (result) {
|
||||
is OidcCallbackResult.Success -> {
|
||||
|
||||
Reference in New Issue
Block a user