Function
The incoming request
A redirect to sign-in, or undefined to let the request through
Optimistic by design — it only looks for the cookie, it does not validate
it. Every personal page verifies the session again on the server
(requireLearnerSession), which is the check that actually protects data.
A path without a locale prefix is left alone: next-intl redirects it to a
localized path first, and that request comes back through here.
The proxy's session check: sends a request for a personal route that carries no session cookie to sign-in, with the route as
next.