自建登录验证码
This commit is contained in:
1 parent
149eb66890
commit
564ffecfed
9 files changed
+75
-49
No files matched your search
@@ -19,7 +19,7 @@ using Jiaowu.Api.Infrastructure.Operations;
|
||||
using Jiaowu.Api.Infrastructure.Persistence;
|
||||
using Jiaowu.Api.Infrastructure.Scheduling;
|
||||
using Jiaowu.Api.Infrastructure.Timetables;
|
||||
using Lazy.Captcha.Core;
|
||||
using CaptchaKit.AspNetCore;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
@@ -393,7 +393,12 @@ builder.Services.AddHybridCache(options =>
|
||||
options.MaximumKeyLength = 512;
|
||||
options.MaximumPayloadBytes = cacheOptions.MaximumPayloadKilobytes * 1024;
|
||||
});
|
||||
builder.Services.AddCaptcha(builder.Configuration);
|
||||
builder.Services.AddCaptchaKit(options =>
|
||||
{
|
||||
options.CodeLength = 5;
|
||||
options.Lifetime = TimeSpan.FromMinutes(2);
|
||||
options.CacheKeyPrefix = "jiaowu:login-captcha:";
|
||||
});
|
||||
builder.Services.AddSingleton<IAppCache, HybridAppCache>();
|
||||
|
||||
builder.Services
|
||||
|
||||
Reference in new issue
Block a user