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

Parse.User.requestEmailVerification fails with code -1 when user is already verified #7740

Open
jonas-db opened this issue Dec 13, 2021 · 7 comments
Labels
bounty:$10 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature

Comments

@jonas-db
Copy link

jonas-db commented Dec 13, 2021

New Issue Checklist

Issue Description

A specific error code when the email verification fails when the user is already verified

Steps to reproduce

call Parse.User.requestEmailVerification when user is already verified

Actual Outcome

{"code":-1,"stack":"Error: Email anmphfnejxtxzkilwb@kvhrw.com is already verified"}

Expected Outcome

A better error code instead of -1
should have message instead of stackproperty?

Environment

Server

  • Parse Server version: "^5.0.0-beta.4",
  • Operating system: macos
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): MongoDB
@parse-github-assistant
Copy link

parse-github-assistant bot commented Dec 13, 2021

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.

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed state:needs-investigation labels Dec 14, 2021
@pash2048
Copy link
Contributor

Hi @mtrezza , May I work on this?

@mtrezza
Copy link
Member

mtrezza commented Dec 22, 2021

@pash2048 sure, please go ahead. I guess the first step would be to identify a better cloud code error number. I suggest you take a look at the Parse Error section in the contribution guide.

I reclassified this as feature since it's a feature related improvement rather than a bug.

@mtrezza mtrezza added bounty:$10 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature and removed type:bug Impaired feature or lacking behavior that is likely assumed state:needs-investigation labels Dec 22, 2021
@pash2048
Copy link
Contributor

Dear @mtrezza , thanks for the opportunity. Very cool. Thumbs up!
at the first, I need to send a pr to parse js SDK for a new Error code after merged change Parse JS SDK dependency in package.json of Parse Server and throw new Parse.Error with those error code in /src/Routes/UsersRouter.js.
everything is alright?

@mtrezza
Copy link
Member

mtrezza commented Dec 24, 2021

Sounds good. For the Parse Server PR: changing the error code is a breaking change. We need to deprecate the old error code with a temporary server option to switch to the new error code. According to our deprecation policy, the new error code will be used by default in Parse Server 7 (2023).

@pash2048
Copy link
Contributor

I did not figure out how I deprecate the old error code with a temporary server option to switch to the new error code. Can you please give me a hint?

@mtrezza
Copy link
Member

mtrezza commented Dec 26, 2021

Sure, please see the contribution guide for how to deprecate a feature and how to add a parse server option.

For each of these there are existing usages in code where you can see how it's implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$10 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

3 participants