~wegtam/smederee

Showing details for patch 03e4f7060a700d0c134b5c11550bee81b4a96ce9.
2024-10-25 (Fri), 8:27 AM - Jens Grassel - 03e4f7060a700d0c134b5c11550bee81b4a96ce9

chore: Some updates to the README

Summary of changes
1 files modified with 11 lines added and 0 lines removed
  • README.md with 11 added and 0 removed lines
diff -rN -u old-smederee/README.md new-smederee/README.md
--- old-smederee/README.md	2024-11-21 22:56:43.834811510 +0000
+++ new-smederee/README.md	2024-11-21 22:56:43.834811510 +0000
@@ -52,6 +52,8 @@
 
 ### Protecting endpoints ###
 
+#### Endpoints only for guests
+
 If an endpoint is intended to be used only by guests (users that are not
 logged in) then it should be implemented two times:
 
@@ -60,6 +62,15 @@
     - a simple redirect (`SeeOther`) or error page
     - put within a middleware with **fall through**
 
+#### Endpoints for guests and users
+
+Endpoints that provide functionality for both guests and users (logged in)
+should have their common logic extracted into a separate function and there
+should be two endpoints:
+
+1. a protected endpoint (`AuthedRoutes`) which calls the logic function
+2. a regular endpoint (`HttpRoutes`) which calls the logic function
+
 ### Tests ###
 
 Tests are included in the project. You can run them via the sbt task `test`.