Code Monkey home page Code Monkey logo

Comments (1)

Merovius avatar Merovius commented on August 19, 2024

I just talked to someone about this and thought I'd see if this is still the case :)

Solution:
Convert email adress to lowercase and strip trailing and leading spaces. Don't forget to update the database - in case someone actually has used uppercase letters or spaces in his registration.

Unfortunately, this solution isn't quite this simple. The reason is, that there are people who have multiple accounts, with different capitalization (because they tried logging in from a different browser, their account couldn't be found and they decided to re-register). You can't simply merge them, because there will be merge conflicts.

So, lower-casing everything in the database is not possible (as that would create multiple accounts with the same E-Mail Address) and lower-casing on registration and login is not possible (as that would disallow logging into an account with upper-case letters).

A fix would be, to insert accounts always lowercased and search always case-insensitive. You can then handle on the application layer what to do. On registration, you can search case-insensitively whether that account exist and refuse if any case-variant already does. On login, you search case-insensitively and if there is exactly one match, you treat them as equal and try to log in that one. If there is more than one match, you treat them as different and look for one with that exact casing. You can also show warnings if conflicts are shown.

Of course, this requires some application-level code, but it should be manageable. You can opt to lower-case all accounts in the DB that are already conflict-free. Once there are no more "conflicting" accounts, you can clean up.

from muesli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.