Support for confirmation of email addresses. #38
Closed
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.
Add support for confirmation of emails.
Created PasswordSignInIfEmailAddressConfirmed next to PasswordSignIn, though it would be nicer if one method could be used like in https://docs.microsoft.com/en-us/aspnet/core/security/authentication/accconfirm?tabs=aspnetcore2x.
Extended SignInResult as to not break any extended code, but I personally think it would be nicer if the SignInResult wasn't focussed on the Owin sign in status, breaking that hardcoded dependency + making it more easily extensible.
Added a method to confirm your email address.
Everything just uses the standard ApplicationUserManager.
I've not added code that generates the token here. In our case, we have a custom RegistrationEmailObserver that adds the token to a custom email. This could again be a nice improvement depending on a setting.
As discussed on Gitter, I realize that you will take steps towards supporting email confirmation, but I need it now. Would appreciate it if this part could already be added to the standard implementation, with any recommendations you may have. If not, I can add the "ConfirmEmailAddress" method to a custom controller, but it's more difficult to do this for the PasswordSignIn because then I'd have to copy all the logic in there, which I'd like to avoid.