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.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,3 +9,5 @@
|
|||||||
.cxx
|
.cxx
|
||||||
local.properties
|
local.properties
|
||||||
/app/build
|
/app/build
|
||||||
|
/.jks
|
||||||
|
/app/release
|
||||||
@@ -30,7 +30,7 @@ class LoginViewModel(private val prefs: UserPreferences, private val appContext:
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
val response = withContext(Dispatchers.IO) {
|
val response = withContext(Dispatchers.IO) {
|
||||||
api.login(LoginRequest(username.lowercase(getDefault()), password))
|
api.login(LoginRequest(username.lowercase(getDefault()).trim(), password))
|
||||||
}
|
}
|
||||||
|
|
||||||
if(response.isSuccessful) {
|
if(response.isSuccessful) {
|
||||||
@@ -45,7 +45,7 @@ class LoginViewModel(private val prefs: UserPreferences, private val appContext:
|
|||||||
|
|
||||||
val account = Account(
|
val account = Account(
|
||||||
id = UUID.fromString(body.user.id),
|
id = UUID.fromString(body.user.id),
|
||||||
name = username,
|
name = username.trim(),
|
||||||
wgName = body.wgName,
|
wgName = body.wgName,
|
||||||
avatarUrl = null,
|
avatarUrl = null,
|
||||||
serverUrl = serverUrl,
|
serverUrl = serverUrl,
|
||||||
|
|||||||
Reference in New Issue
Block a user