-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Bugfix/resend verification email link #7533
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
Conversation
…f set, is included in the "Resend Link" form's action URL
Codecov Report
@@ Coverage Diff @@
## master #7533 +/- ##
==========================================
- Coverage 93.95% 84.70% -9.25%
==========================================
Files 181 181
Lines 13273 13273
==========================================
- Hits 12470 11243 -1227
- Misses 803 2030 +1227
Continue to review full report at Codecov.
|
Thanks for opening this PR! If this is in reference to #3857, could you please add this reference to the PR description? |
Sure, I've now added a reference to that issue. |
Looking closer, I am hesitant to approve this PR, because:
The likeliness that this PR would either break something or it doesn't have any effect at all, maybe not be worth the risk. Considering that this change will be obsolete in 3-4 months, with the release of Parse Server 5.0 and the Pages Router, in which the button URL will be fully provided by the server:
The Pages Router is still flagged as "experiemental" in Parse Server 5.0 but in reality it has been used heavily in production systems since March 2021, without a single bug being reported. So this PR would really only be relevant if backported for Parse Server 4.x releases, which we are unlikely to do, because of the reasons above. I still think that your solution in this PR could be helpful to others if they come across the same issue and the solution works for them. |
New Pull Request Checklist
Issue Description
Currently, if you use a custom Public Server URL for your Parse Server setup, then the "Resend Link" button on the Invalid Verification Link page is broken. When pressing the button you get redirected to a page with a "error: unauthorized" error message.
This is because the button's form is always pointing at
/apps/<appId>/resend_verification_email
, and not at<public-server-url>/apps/<app-id>/resend_verification_email
. I.e. it doesn't take public Server URL into consideration.I've made a fix, where the page's client-side Javascripts checks its URL for whether it has a public Server Url. If so, then it's prepended to the form's action URL.
This already seems to be fixed for the next major release (5.0.0) of parse-server, where PagesRouter will replace the PublicApiRouter. For PagesRouter it uses completely new HTML templates (under public/), and publicServerUrl seems to be used correctly there.
Related issue:
Approach
TODOs before merging