Concept Flow - Authentication middleware
Request received
Middleware invoked
Check if user is authenticated
Allow request
View processes request
Response sent back
The middleware intercepts each request, checks if the user is logged in, and either allows the request to continue or redirects to login.