mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-10-10 22:28:41 +02:00
global: add some basic rate limiting
This commit is contained in:
1 parent
8c267e51f4
commit
34fa43f302
6 files changed
+26
-1
No files matched your search
@@ -31,6 +31,7 @@ using IdentityServer4.Stores;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.RateLimiting;
|
||||
using Streetwriters.Common;
|
||||
using Streetwriters.Common.Enums;
|
||||
using Streetwriters.Common.Interfaces;
|
||||
@@ -112,6 +113,7 @@ namespace Streetwriters.Identity.Controllers
|
||||
}
|
||||
|
||||
[HttpPost("verify")]
|
||||
[EnableRateLimiting("strict")]
|
||||
public async Task<IActionResult> SendVerificationEmail([FromForm] string newEmail)
|
||||
{
|
||||
var client = Clients.FindClientById(User.FindFirstValue("client_id"));
|
||||
@@ -145,6 +147,7 @@ namespace Streetwriters.Identity.Controllers
|
||||
|
||||
[HttpPost("recover")]
|
||||
[AllowAnonymous]
|
||||
[EnableRateLimiting("strict")]
|
||||
public async Task<IActionResult> ResetUserPassword([FromForm] ResetPasswordForm form)
|
||||
{
|
||||
var client = Clients.FindClientById(form.ClientId);
|
||||
|
||||
Reference in new issue
Block a user