Documentation
¶
Overview ¶
Package middleware provides HTTP middleware for the outtake API.
Index ¶
Constants ¶
View Source
const SessionKeyToken = identity.SessionKeyToken
SessionKeyToken is the session key used to store the Plex authentication token.
Variables ¶
This section is empty.
Functions ¶
func AuthGuard ¶
AuthGuard rejects a request that has no Plex token in its session.
Parameters:
- env: Configured environment. The e2e environment skips the check.
Returns:
- handler: Middleware that redirects or answers anonymous requests.
func BindCSRFToken ¶
BindCSRFToken copies the Fiber CSRF token onto the request context for templates.
Returns:
- handler: Middleware that stores the token and continues the chain.
func RequestLogger ¶
RequestLogger logs one line per request after the handler chain returns.
Returns:
- handler: Middleware that logs method, path, status, and duration.
func RestoreToken ¶
func RestoreToken(store identity.TokenStore) fiber.Handler
RestoreToken loads a persisted Plex token into the session when missing.
Parameters:
- store: Persisted token store.
Returns:
- handler: Middleware that seeds the session and continues the chain.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.