Closed robere2 closed 3 months ago
Just to clarify, you want the username to be case-sensitive? So in this case, if they signed up with robere2, it HAS to be robere2 and not Robere2.
Correct! Or perhaps more accurately, all usernames should be required to be lowercase, so all username inputs should also be converted to lowercase.
If you're interested in tackling this issue, I believe you're going to want to update the GraphQL resolvers for createUser
and updateUser
to modify input.username
to be lowercase (note that input.username
may be undefined in the updateUser
resolver).
Update username to be lowercase in attemptLogin
as well in auth.service.ts
.
There's no way for new users to make their own accounts right now, so you don't need to worry about that.
There may be additional locations in the code where this will need to be fixed, such as search filters, but I haven't tested this and this may be a more complex issue that deserves its own lower-priority issue. Feel free to tackle them if you notice them.
Okay so would you prefer me just to work on the lowercase and just that? If so, I can work on this but there might be a few trial and errors because I have not worked with GraphQL.
If a username in the database is
robere2
but they try to log in asRobere2
, it will fail. Make sure that you don't just perform a case-insensitive check on login, but on account registration as well (if that does not already exist).