Skip to content

Commit dd92be6

Browse files
committed
Trim trailing newlines from passkey user id
This commit updates the `PasskeyAttestationOptionsSanitizer` to only trim trailing newlines from the user id. Previously, it would trim both leading and trailing whitespace, which could incorrectly alter user ids that legitimately start with whitespace characters. The `trim()` function has been replaced with `trimEnd()` to correct this behavior.
1 parent 50cfa57 commit dd92be6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/kotlin/com/x8bit/bitwarden/data/credentials/sanitizer/PasskeyAttestationOptionsSanitizerImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object PasskeyAttestationOptionsSanitizerImpl : PasskeyAttestationOptionsSanitiz
1515
options.user.id.endsWith("\n")
1616
) {
1717
options.copy(
18-
user = options.user.copy(id = options.user.id.trim()),
18+
user = options.user.copy(id = options.user.id.trimEnd()),
1919
)
2020
} else {
2121
options

0 commit comments

Comments
 (0)