Skip to content

Changing user's email: keep using old email before verification new one #5147

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

Closed
wants to merge 11 commits into from

Conversation

Nes-si
Copy link
Contributor

@Nes-si Nes-si commented Oct 26, 2018

There is a realization of feature that I've described in this issue. The user can change his email and use an old one until he confirm the new email.
To change email, user should send POST request to /requestEmailChange with parameter email (new). The new email will be putted to emailNew DB field. When the user confirm it, the new email will be putted to email field, and emailNew will be cleared.
Also I'll prepare a PR to Parse-SDK-JS with this method.

If one needs to block manual email changing (that bypass new scheme), the block in RestWrite.js should be uncommented:

// TODO: block manually email changing
/*
  if (!this.auth.isMaster && 'email' in this.data && !('createdAt' in this.data)) {
    const error = `Clients aren't allowed to manually update email. Please, use "requestEmailChange" function`;
    throw new Parse.Error(Parse.Error.OPERATION_FORBIDDEN, error);
  }
*/

@flovilmart
Copy link
Contributor

flovilmart commented Oct 26, 2018 via email

@Nes-si
Copy link
Contributor Author

Nes-si commented Oct 27, 2018

@flovilmart I'm not sure, I'll try. I don't have a considerable experience in testing.

@stale
Copy link

stale bot commented Dec 11, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 11, 2018
@stale stale bot closed this Dec 18, 2018
@dplewis dplewis removed the wontfix label Mar 15, 2019
@dplewis dplewis reopened this Mar 15, 2019
@codecov
Copy link

codecov bot commented Mar 15, 2019

Codecov Report

Merging #5147 into master will decrease coverage by 0.34%.
The diff coverage is 52.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5147      +/-   ##
==========================================
- Coverage   93.88%   93.53%   -0.35%     
==========================================
  Files         123      123              
  Lines        8939     8977      +38     
==========================================
+ Hits         8392     8397       +5     
- Misses        547      580      +33
Impacted Files Coverage Δ
src/Controllers/SchemaController.js 96.32% <ø> (ø) ⬆️
src/RestWrite.js 92.89% <100%> (-0.54%) ⬇️
src/Routers/UsersRouter.js 82.12% <37.14%> (-11.35%) ⬇️
src/Controllers/UserController.js 89.74% <73.68%> (-3.66%) ⬇️
src/Adapters/Storage/Mongo/MongoTransform.js 87.79% <0%> (-0.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update daab378...528f6d9. Read the comment docs.

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

Successfully merging this pull request may close these issues.

3 participants