Skip to content

Commit

Permalink
Use password keyboard type for inputs in PasswordDialog
Browse files Browse the repository at this point in the history
This disables dictionary and autocorrect for password inputs, which could leak entered passwords. Fixes twofas#152
  • Loading branch information
prokoma committed Sep 8, 2024
1 parent db17645 commit c9d5863
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.DialogProperties
Expand All @@ -36,7 +37,9 @@ fun PasswordDialog(
onPositive: ((String) -> Unit)? = null,
onNegative: (() -> Unit)? = null,
validation: ((String) -> Boolean)? = null,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default.copy(
keyboardType = KeyboardType.Password,
),
minLength: Int = 3,
maxLength: Int = Int.MAX_VALUE,
confirmRequired: Boolean = true,
Expand Down

0 comments on commit c9d5863

Please sign in to comment.