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

Support users use their email as their username #55

Open
4 tasks done
yomybaby opened this issue Dec 5, 2021 · 2 comments · May be fixed by #54
Open
4 tasks done

Support users use their email as their username #55

yomybaby opened this issue Dec 5, 2021 · 2 comments · May be fixed by #54

Comments

@yomybaby
Copy link

yomybaby commented Dec 5, 2021

New Issue Checklist

Issue Description

Parse-server supports "users use their email as their username" :

On the resetting passwords section of parse-server JS SDK document,

This will attempt to match the given email with the user’s email or username field, and will send them a password reset email. By doing this, you can opt to have users use their email as their username, or you can collect it separately and store it in the email field.

On the signing up section,

You are free to use an email address as the username. Simply ask your users to enter their email, but fill it in the username property — Parse.User will work as normal. We’ll go over how this is handled in the reset password section.

Email adapter have to handle username as an email in this case.
When the adapter got there user object as recipient and email filed of user is empty, use username as an email.

Parse-server check below code of parse-server:

If you want check the early discussion of this issue, please check this

Steps to reproduce

  • Setup parse-server with this email adapter.
  • Sing up : use their email as their username
  • Request password reset
Parse.User.requestPasswordReset("email@example.com")

Actual Outcome

You can't not get any email.

Expected Outcome

You can get an "reset password email".

Failing Test Case / Pull Request

#54

Environment

  • API Mail Adapter version: 2.10
  • Parse Server version: 4.10.4

Logs

@yomybaby yomybaby linked a pull request Dec 5, 2021 that will close this issue
@mtrezza
Copy link
Member

mtrezza commented Dec 5, 2021

Thanks for opening this issue. That's an interesting behavior of Parse Server. I understand the intention of that behavior, but I am not sure it should be that way, because its an unclean approach in terms of data separation, and it creates a lot of issues down the road. It probably also breaks the email verification logic for that user. If the user has an email in the username field and a different email in the email field, it's unclear which email would be verified. So this looks much like a bug in Parse Server, which should be fixed.

If Parse Server currently behaves that way, and we decide to propagate the bug into this email adapter, we would need to consider the order of the fields checked, in case there are two different email addresses stored. Is it email || username or username || email?

In any case, it would be good if you could additionally open an issue in Parse Server about this.

@mtrezza mtrezza changed the title Supports "users use their email as their username". Support users use their email as their username May 15, 2022
@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants