Documentation
¶
Overview ¶
Package fiber provides a Fiber middleware adapter for authula.
It bridges Fiber's fasthttp-based context to authula's standard net/http.Handler by manually constructing http.Request objects. This avoids fasthttpadaptor which can lose the request body — a critical issue for authentication payloads.
Usage:
auth := authula.New(&authula.AuthConfig{...})
app := fiber.New()
app.Use("/api/auth", fiberadapter.New(fiberadapter.Config{
Handler: auth.Handler(),
}))
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Handler is the authula http.Handler. Required.
// Obtain it via auth.Handler().
Handler http.Handler `json:"-" toml:"-"`
// Next defines a function to skip this middleware when returning true.
// Optional. Default: nil (never skip).
Next func(c fiber.Ctx) bool `json:"-" toml:"-"`
// ErrorHandler is called when the adapter encounters an internal error
// (e.g., a malformed request URL). Optional. Default: returns 500 JSON.
ErrorHandler fiber.ErrorHandler `json:"-" toml:"-"`
}
Config defines the config for the authula Fiber adapter middleware.
Click to show internal directories.
Click to hide internal directories.