0
LiSong created
- ABP Framework version: v9.X.X
- UI Type: Angular / MVC / Blazor WASM / Blazor Server
- Database System: SQL Server
- Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
- Exception message and full stack trace:
- Steps to reproduce the issue:
When an user created a new account, the confirm your email page shows, and there is a Verify button, before they click the button, a confirmation email was sent to their inbox, and if the users click the Verifiy button again, they receive another same email again. is there a way to avoid this? for instance, wait they click the Verify button before sending the first email; or check the email sent log(is there logs for this), if the same email has been sent, prevent the system to send it twice. any suggestions?
4 Answer(s)
-
0
-
0
If you want to check on the server side, you can try to override the
SendEmailConfirmationTokenAsync
method.[Dependency(ReplaceServices = true)] [ExposeServices(typeof(AccountAppService))] public class MyAccountAppService : AccountAppService { protected override async Task SendEmailConfirmationTokenAsync(IdentityUser user, string applicationName, string returnUrl, string returnUrlHash) { var isEmailSent = // get from cache or db. if(isEmailSent){ throw new UserfriendlyException("...") }else{ var confirmationToken = await UserManager.GenerateEmailConfirmationTokenAsync(user); await AccountEmailer.SendEmailConfirmationLinkAsync(user, confirmationToken, applicationName, returnUrl, returnUrlHash); // add confirmationToken to cache or db } } }
-
0
In the latest version, the button will be hidden to prevent multiple send email.
Which version?
-
0
Hi, 9.0.3