-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Fix broken resend email validation link #4002
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
Fix broken resend email validation link #4002
Conversation
it will be a view now as it contains templated parameters
Also the spec needs to be fixed. I did some changes in the spec but I do not think it is correct yet. |
Hey @funkenstrahlen, this approach seems to be the best one, perhaps we should cache the file in memory, instead of reading from it all the times. |
Do you think the increased memory footprint is worth it? This page will not be accessed very frequently. But I will leave this decision to you as you know more about parse server than I do. How can I keep it in memory? Maybe just a global variable containing the parsed page which will be initialised on first access? |
Codecov Report
@@ Coverage Diff @@
## master #4002 +/- ##
==========================================
- Coverage 92.84% 90.39% -2.45%
==========================================
Files 118 118
Lines 8381 8267 -114
==========================================
- Hits 7781 7473 -308
- Misses 600 794 +194
Continue to review full report at Codecov.
|
@flovilmart I implemented a first approach caching the template file in memory. It does not feel perfectly right to put this kind of code into the router file though. Also I am not an experienced JS developer. I am happy if you can take a look at my approach. |
@funkenstrahlen can you check, it seems there are some linting issues. |
Will take a look at it someday next week |
…funkenstrahlen/parse-server into fix-broken-resend-email-validation-link
@@ -36,8 +36,7 @@ describe("Email Verification Token Expiration: ", () => { | |||
request.get(sendEmailOptions.link, { | |||
followRedirect: false, | |||
}, (error, response) => { | |||
expect(response.statusCode).toEqual(302); | |||
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/invalid_verification_link.html?username=testEmailVerifyTokenValidity&appId=test'); | |||
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/invalid_verification_link'); |
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.
why are those changed? That seems to be a breaking change
I fixed the syntax errors, but the test cases for invalid verification link pages do still fail. |
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. |
This fixes issue: #3857 (Missing mount point in "invalid_verification_link.html")
The old approach was to use Javascript and work with regex on the url. This is a bad approach.
I therefore took another approach using templating. I discovered that
changePassword
inPublicAPURouter
already uses (some kind of) templating. This is very basic but seems to work.I adopted this approach for
invalidVerificationLink
.@flovilmart This change is currently untested and just a first POC. I would love to get your comment on this.