Is there a way to trim the password of a user when signing in?

0
Hi all,   Is there a way to trim the password of a user when signing in? We experience that there a some users that copy/paste a space behind their password and call our customer services for this. We are currently using the standard Mendix login page.
asked
3 answers
2

If you have a custom login page, you can use the Auth widgets and create a custom sign-in nanoflow.

In this nanoflow you can trim the password before using it to perform the login action.

 

answered
3

I wouldn't recommend automatically trimming unless you explicitly exclude spaces from passwords, otherwise it'll be impossible for other users to login if their password happens to end with a space. I would look into a different solution for this issue.

answered
0

You can do this by adding a function to the onchange function of your html input, see https://www.w3schools.com/jsref/event_onchange.asp

 

You can then use the trim() function to trim spaces, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim.

 

On a side note: if you also want to make things lowercase, make sure to add an exception for MxAdmin, otherwise you can't login with this account anymore.

answered