I have created multiple user documents in the _users database with the following in the “name” property:
"johnny.weng.luu@gmail.com"
"mammamia"
"mamma/mia"
"mamma:mia"
I logged in each one of them (the password is the same for all of them) and then I tried to get the current user session with GET /_session with cookie auth.
It worked for the first 3 documents but not for the 4th one.
The conclusion is that if I have a : in the “name” it won’t work.
So now I want to change the format of the “name” value so that it won’t have the : in there. Is this about encryption or encoding and how do I do that in Javascript?
you can just use javascript’s native string replace function:
this will replace all occurences of “:” with nothing
then you would need to update your database with the new names and maybe prevent users from using such characters in the future