Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings email verification removes symbols #143

Open
rodrigoricky opened this issue Jun 6, 2022 · 4 comments
Open

Settings email verification removes symbols #143

rodrigoricky opened this issue Jun 6, 2022 · 4 comments

Comments

@rodrigoricky
Copy link

When you create an account with an email like let's say: [email protected], and when you go to settings, in the Note: your email Is unverified, etc area, it will show your email as: [email protected]

@rodrigoricky rodrigoricky changed the title Email note removes symbols Settings email verification removes symbols Jun 6, 2022
@danielmeeusen
Copy link

danielmeeusen commented Jun 6, 2022

Gmail doesn't care about dots in the username of the email.

[email protected] is an alias of [email protected] and vice versa.

However if you don't want to remove dots from gmail addresses you can replace all instances of normalizeEmail(email) with normalizeEmail(email, { gmail_remove_dots: false })

@hoangvvo
Copy link
Owner

I think this is a valid issue. The right solution is to have two fields in the collection:

{
   "email": "email that has been normalized",
   "emailOriginal": "original email that is used to signed up"
}

PR are welcome! I can then help with a script to add that field for previous users.

@danielmeeusen
Copy link

I can do a PR if you want.

Can I ask why you removed the database middleware pattern in the last update?

@hoangvvo
Copy link
Owner

Can I ask why you removed the database middleware pattern in the last update?

I think it is an non-ideal pattern. The previous basically sets the database to req.db, but an issue is that this is hard to track. Let's say we write a handler elsewhere, we would be unsure if req.db is actually available and would need to look through the middleware chain.

Also looking at usages like the one at https://github.com/hoangvvo/nextjs-mongodb-app/pull/145/files#diff-12ea791bfe0cc914d5dfff0850152ca3e25a4fe4bc02d4b7f90ac7f2537002fdL20-L22: having next-connect just to connect to the database is redundant.

This was referenced Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants