Pass service provide recaptcha

This commit is contained in:
2025-07-16 22:29:46 +08:00
parent e4dcf2517a
commit 022f89c36e
11 changed files with 127 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
using DysonNetwork.Shared.PageData;
namespace DysonNetwork.Pass.Pages.Data;
public class CaptchaPageData(IConfiguration configuration) : IPageDataProvider
{
public bool CanHandlePath(PathString path) => path == "/captcha";
public Task<IDictionary<string, object?>> GetAppDataAsync(HttpContext context)
{
var provider = configuration.GetSection("Captcha")["Provider"]?.ToLower();
var apiKey = configuration.GetSection("Captcha")["ApiKey"];
return Task.FromResult<IDictionary<string, object?>>(new Dictionary<string, object?>
{
["Provider"] = provider,
["ApiKey"] = apiKey
});
}
}