stevenleeg / gobb

A simple and fast bulletin board written in Go.
Other
131 stars 26 forks source link

Make usernames case insensitive #19

Open stevenleeg opened 10 years ago

stevenleeg commented 10 years ago

It's possible to create usernames with the same name but different cases, which is a problem. Make usernames case insensitive when registering, checking, and logging in.

cwaldren commented 10 years ago

So is testUsername going to be different, or the same as testusername or TeStUsErNaMe?

stevenleeg commented 10 years ago

I believe it will see them as two separate usernames and allow them to coexist.

ocrumbs commented 10 years ago

Before authentication, force the input to lowercase strings.ToLower("MyUsername"). And always store the username in original format (i.e. the one provided by the user). Additionally/Optionally store key value set of both (lowercase version and original)