-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Resend Verification Email Endpoint #3543
Conversation
I think the test failure here is unrelated to this change. Can this be re-queued on Travis? |
You can close and reopen to kick the tests off again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xyziemba I'm re-running the test and will look at the output. The better email verification is not necessary if you want to leave as is....
if (!email) { | ||
throw new Parse.Error(Parse.Error.EMAIL_MISSING, 'you must provide an email'); | ||
} | ||
if (typeof email !== 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe try and make this available and useful? https://github.com/ParsePlatform/parse-server/blob/0e900cbefda1ce1803e0bd78839afffdcfa01765/src/RestWrite.js#L415
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a natural place for this kind of utility code? I couldn't find one, and I'm not sure it makes sense to create one just to de-dup this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good question... @flovilmart, any thoughts/wisdom for us?
src/Routers/UsersRouter.js
Outdated
|
||
return req.config.database.find('_User', { email: email }).then((results) => { | ||
if (!results.length || results.length < 1) { | ||
throw new Parse.Error(Parse.Error.EMAIL_NOT_FOUND, 'Invalid email.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than Invalid email
something like ${email} not found
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to No user found with email ${email}
so it matches the error in handleResetRequest
.
hm test still fails. lets see if updating branch fixes??? |
@xyziemba updated the pull request - view changes |
@xyziemba updated the pull request - view changes |
I just stumbled on this issue as I try to implement resending email verification. There is no word about this feature in the parse docs. How can I use it? |
I have the same question. I used to update emailVerified flag but that no longer works after I upgrade to latest Parse. Thanks for implementing this feature. But how can I use it? |
I created a cloud function like this: Parse.Cloud.define("verificationEmailRequest", function(request, response) {
var email = request.params.email
if (email) {
verificationEmailRequest(email).then(function() {
console.log("sent verification mail to " + email);
response.success();
}).catch(function(error) {
console.log(error);
response.error(error);
});
} else {
response.error("email parameter required")
}
});
function verificationEmailRequest(email) {
var url = process.env.SERVER_URL + '/verificationEmailRequest';
return Parse.Cloud.httpRequest({
method: 'POST',
url: url,
body: {
'email': email
},
headers: {
"X-Parse-Application-Id": process.env.APP_ID,
"X-Parse-Master-Key" : process.env.MASTER_KEY,
"Content-Type": "application/json"
}
});
} |
Thank you very much @funkenstrahlen! work like a charm! |
This comment was marked as off-topic.
This comment was marked as off-topic.
@hphtoo For help with Parse Platform please use the community forum or community chat; we use GitHub to discuss actual product issues. In fact, if there is a bug and the endpoint cannot be called anymore, this should be discussed in a separate issue so we can fix it. |
This adds an endpoint,
/verificationEmailRequest
, that allows a client to request a re-send of a verification email. I had implemented this for my own private use, but I noticed an issue and Stack Overflow question asking about this, so I'd like to get it upstream if possible.