pub async fn require_session(
__arg0: State<AppState>,
req: Request,
next: Next,
) -> ResponseExpand description
Middleware that enforces a valid session on the wrapped routes.
On reject:
- a GET request that prefers
text/htmlis redirected to/login?next=... - any other request gets a JSON 401.
ยงErrors
Returns the Error::Unauthenticated variant; the
axum::response::IntoResponse impl will turn it into the appropriate
response.