From e99e951232a2d8e4898312a63eda5aa2330687e7 Mon Sep 17 00:00:00 2001 From: "Maurice L." Date: Fri, 27 Feb 2026 19:23:04 +0100 Subject: [PATCH] Updated Login and Git configuration The `LoginViewModel` now trims whitespace from usernames during the login request and account creation process. The `.gitignore` file has been updated to exclude `.jks` files and the `/app/release` directory. --- .gitignore | 4 +++- .../de/miaurizius/shap_planner/viewmodels/LoginViewModel.kt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8a2cbf9..a30726a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ .externalNativeBuild .cxx local.properties -/app/build \ No newline at end of file +/app/build +/.jks +/app/release \ No newline at end of file diff --git a/app/src/main/java/de/miaurizius/shap_planner/viewmodels/LoginViewModel.kt b/app/src/main/java/de/miaurizius/shap_planner/viewmodels/LoginViewModel.kt index c20f2da..5265e9b 100644 --- a/app/src/main/java/de/miaurizius/shap_planner/viewmodels/LoginViewModel.kt +++ b/app/src/main/java/de/miaurizius/shap_planner/viewmodels/LoginViewModel.kt @@ -30,7 +30,7 @@ class LoginViewModel(private val prefs: UserPreferences, private val appContext: try { val response = withContext(Dispatchers.IO) { - api.login(LoginRequest(username.lowercase(getDefault()), password)) + api.login(LoginRequest(username.lowercase(getDefault()).trim(), password)) } if(response.isSuccessful) { @@ -45,7 +45,7 @@ class LoginViewModel(private val prefs: UserPreferences, private val appContext: val account = Account( id = UUID.fromString(body.user.id), - name = username, + name = username.trim(), wgName = body.wgName, avatarUrl = null, serverUrl = serverUrl,