diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6a93ddd..017394b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,23 +6,15 @@ *Describe the proposed solution and changes. How does it affect the project? How does it affect the internal structure (e.g., refactorings)?* -## 📷: Screenshots +## 📷 Screenshots *Provide screenshots showcasing the changes before and after the proposed changes (if applicable).* -## 📋 : Release Notes +## 📚 Release Notes *Provide a summary of the changes or features from a user's point of view. If there are breaking changes, provide migration guides using code examples of the affected features.* - - -## :heavy_plus_sign: Additional Information -*If applicable, provide additional context in this section.* - -### Testing +## 📝 Testing *Which tests were added? Which existing tests were adapted/changed? Which situations are covered, and what edge cases are missing?* -### Reviewer Nudging - -*Where should the reviewer start? what is a good entry point?* diff --git a/app/src/main/kotlin/cloud/keyspace/android/AddLogin.kt b/app/src/main/kotlin/cloud/keyspace/android/AddLogin.kt index 6e1dba2..1b32a80 100644 --- a/app/src/main/kotlin/cloud/keyspace/android/AddLogin.kt +++ b/app/src/main/kotlin/cloud/keyspace/android/AddLogin.kt @@ -195,6 +195,11 @@ class AddLogin : AppCompatActivity() { } } + if (secretInput.text.toString().isNotBlank() && secretInput.text.toString().length < 6) { + secretInput.error = "Please enter a valid TOTP secret" + return@setOnClickListener + } + saveItem() } @@ -629,7 +634,7 @@ class AddLogin : AppCompatActivity() { override fun afterTextChanged (s: Editable) { } override fun beforeTextChanged (s: CharSequence, start: Int, count: Int, after: Int) { } override fun onTextChanged (s: CharSequence, start: Int, before: Int, count: Int) { - if (s.length >= 8) { + if (s.length >= 6) { try { otpCode = GoogleAuthenticator(base32secret = secretInput.text.toString()).generate() runOnUiThread { tokenPreview.text = otpCode!!.replace("...".toRegex(), "$0 ") }