Kotlin / kmm-integration-sample

Apache License 2.0
93 stars 48 forks source link

IME_ACTION_DONE is possible with empty credential fields #1

Open cryptedx opened 3 years ago

cryptedx commented 3 years ago

https://github.com/Kotlin/kmm-integration-sample/blob/d4cd7a146f870555e2dd4c5c748f6e467a70f8fe/app/src/main/java/com/jetbrains/simplelogin/androidapp/ui/login/LoginActivity.kt#L83

If you go into the password field and hit done with keyboard you are logged in...

Possible solution:

setOnEditorActionListener { _, actionId, _ ->
                when {
                    actionId == EditorInfo.IME_ACTION_DONE && login.isEnabled -> {
                        loginViewModel.login(
                            email.text.toString(),
                            password.text.toString()
                        )
                    }
                }
                false
            }