Element-android: Whitespace at the end of the password is not removed

Created on 19 Feb 2020  路  5Comments  路  Source: vector-im/element-android

If you paste the backup key password into riotx and there is a space at the end, it will be kept. As c&p from other apps might cause this, this causes unexpected user experience.

Tested on 0.16.0

login

Most helpful comment

If you want to be very explicit, maybe the last variant is the best, notifying the user of something that might possible go wrong.

All 5 comments

Space is a valid character for passwords in lmatrix world, and we cannot take the responsibility to trim what user is entering, else, some users will be stucked

What if you add the following logic to riotx:

  • try logging in with whitespace at beginning and end not trimmed
  • if that fails: try logging in with whitespace at beginning and end trimmed

This way there is no surprise for users who copied & pasted their password and neither for the (I assume very rare) cases when someone has a leading or ending whitespace.

Password field has a reveal button (an eye), user can see the password in clear and detect a possible mistake with spaces.
I'm not sure it's a good idea to try several trimmed password, but why not...
We could also add a warning under the password field if a space is detected at beginning or end of password, the same way computer warn if the CAPS lock is on when entering password.

If you want to be very explicit, maybe the last variant is the best, notifying the user of something that might possible go wrong.

I'm not sure it's a good idea to try several trimmed password, but why not...

True, it could trigger security mechanisms in very sensitive setups

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kekun picture Kekun  路  3Comments

532910 picture 532910  路  3Comments

commagray picture commagray  路  3Comments

matrixes picture matrixes  路  3Comments

Yajo picture Yajo  路  3Comments