DEV Community

Discussion on: Authentication in NodeJS With Express and Mongo - CodeLab #1

cwills0114 profile image

Would anyone be able to help me?
Looking to try and convert the email to all lowercase before it gets posted to the database within the signin and then convert to lowercase before it gets compared on login?


dipakkr profile image
Deepak Kumar Author

In JavaScript to convert a string to lowercase you can string method 'toLowerCase()'

I hope it answers your question.

cwills0114 profile image
Cwills0114 • Edited on

Thanks for the response,

I have managed to figure this out.
Just as simple as adding a Constraint into the model for
Lowercase: true