From 7a726454379e7cd2d2d1e2ac1cb830a01099dfd4 Mon Sep 17 00:00:00 2001 From: the1mason Date: Thu, 9 Jan 2025 22:29:56 +0500 Subject: [PATCH] Full-working auth, adding profile --- .../Controllers/TooManyRequestsController.cs | 12 ++++++++++++ src/FastBlog.Web/HtmxAttribute.cs | 6 ++++++ src/FastBlog.Web/Views/TooManyRequests/Index.cshtml | 12 ++++++++++++ .../Views/Users/{Login.cshtml => LogIn.cshtml} | 0 src/FastBlog.Web/Views/Users/Profile.cshtml | 2 ++ 5 files changed, 32 insertions(+) create mode 100644 src/FastBlog.Web/Controllers/TooManyRequestsController.cs create mode 100644 src/FastBlog.Web/HtmxAttribute.cs create mode 100644 src/FastBlog.Web/Views/TooManyRequests/Index.cshtml rename src/FastBlog.Web/Views/Users/{Login.cshtml => LogIn.cshtml} (100%) create mode 100644 src/FastBlog.Web/Views/Users/Profile.cshtml diff --git a/src/FastBlog.Web/Controllers/TooManyRequestsController.cs b/src/FastBlog.Web/Controllers/TooManyRequestsController.cs new file mode 100644 index 0000000..f7a43ee --- /dev/null +++ b/src/FastBlog.Web/Controllers/TooManyRequestsController.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; + +namespace FastBlog.Web.Controllers; + +public class RateLimitController : Controller +{ + [HttpGet("/RateLimited")] + public IActionResult Index() + { + return View(); + } +} \ No newline at end of file diff --git a/src/FastBlog.Web/HtmxAttribute.cs b/src/FastBlog.Web/HtmxAttribute.cs new file mode 100644 index 0000000..bb708b4 --- /dev/null +++ b/src/FastBlog.Web/HtmxAttribute.cs @@ -0,0 +1,6 @@ +namespace FastBlog.Web; + +public class HtmxAttribute +{ + +} \ No newline at end of file diff --git a/src/FastBlog.Web/Views/TooManyRequests/Index.cshtml b/src/FastBlog.Web/Views/TooManyRequests/Index.cshtml new file mode 100644 index 0000000..4dec476 --- /dev/null +++ b/src/FastBlog.Web/Views/TooManyRequests/Index.cshtml @@ -0,0 +1,12 @@ +@{ + ViewBag.Title = "Rate limit exceeded"; +} + +
+
+
Rate limit exceeded!
+
+

You have sent too many requests!

+
+
+
\ No newline at end of file diff --git a/src/FastBlog.Web/Views/Users/Login.cshtml b/src/FastBlog.Web/Views/Users/LogIn.cshtml similarity index 100% rename from src/FastBlog.Web/Views/Users/Login.cshtml rename to src/FastBlog.Web/Views/Users/LogIn.cshtml diff --git a/src/FastBlog.Web/Views/Users/Profile.cshtml b/src/FastBlog.Web/Views/Users/Profile.cshtml new file mode 100644 index 0000000..a02989a --- /dev/null +++ b/src/FastBlog.Web/Views/Users/Profile.cshtml @@ -0,0 +1,2 @@ +@model TModel +