问题是由于ASP.Net Core 7中的默认实现未将电子邮件确认代码持久化到Redis中而引起的。要解决此问题,需要实现自定义存储提供程序以将电子邮件确认代码存储在Redis中。
以下是示例代码,可以在Startup.cs文件中的ConfigureServices方法中添加:
services.AddIdentity
services.Configure
services.Configure
services.AddSingleton
services.AddScoped
其中CustomEmailConfirmation是自定义电子邮件确认代码提供程序的名称,并且CustomEmailConfirmationTokenProviderOptions是用于配置Redis连接的选项类。如果没有定义上下文,可以使用AddEntityFrameworkStores
上一篇:ASP.NETCore7RC2在Linux上使用KestrelHTTP3/QUIC时,“Theconnectionlistenerfailedtoacceptanynewconnections。
下一篇:ASP.NETCore7System.InvalidOperationException:TheConnectionStringpropertyhasnotbeeninitialized