More changes for Microsoft Safe link protection #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, after testing my site internally, the previous fix of just checking for a
HEAD
request was fine. As I was accessing my site with a private IP address. However, after deploying the site, it turns out that Microsoft actually checks the link before it even sends the email. So the link is always invalid when the user finally gets it.My solution here is to add a page where the user must click a button for the verification to actually be processed. The pros of this approach is that it doesn't matter what checks Microsoft, or anyone does on the email link, as the user must press the verify button for the verification to proceed.
The cons are that it adds another step in for the end user and the link in the email remains valid no matter how many times the user click on it, it is only used once they click the verify button.
I added a template that matches the rest of the templates and can be swapped out with a custom template like all the others.
This is potentially only an issue when using the
mail.protection.outlook.com
email providerAlso, the verification email would not send without error unless I removed
inactive_user=None,
from