Documentation
¶
Index ¶
- Variables
- func ClearAuthCookies(c *fiber.Ctx)
- func ConfigureLogger(env string) *slog.Logger
- func IsAuthenticated(config *JWTConfig, require2FA bool, isPage bool) fiber.Handler
- func NewCORS(config CORSConfig) fiber.Handler
- func RedirectIfAuthenticated(config *JWTConfig) fiber.Handler
- func SetAuthCookies(c *fiber.Ctx, accessToken, refreshToken string, config *JWTConfig)
- func StructuredLogger() fiber.Handler
- type CORSConfig
- type JWTClaims
- type JWTConfig
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ClearAuthCookies ¶
func ClearAuthCookies(c *fiber.Ctx)
ClearAuthCookies removes both access and refresh token cookies
func ConfigureLogger ¶
func IsAuthenticated ¶
func NewCORS ¶
func NewCORS(config CORSConfig) fiber.Handler
NewCORS creates a new CORS middleware with the given config
func RedirectIfAuthenticated ¶
func RedirectIfAuthenticated(config *JWTConfig) fiber.Handler
func SetAuthCookies ¶
SetAuthCookies sets both access and refresh token cookies
func StructuredLogger ¶
func StructuredLogger() fiber.Handler
StructuredLogger logs a Fiber HTTP request using slog.
Types ¶
type CORSConfig ¶
type CORSConfig struct {
AllowOrigins string
}
CORSConfig holds the configuration for CORS
type JWTClaims ¶
type JWTClaims struct {
ID string `json:"id"`
AMR string `json:"amr"`
Type string `json:"type"` // "access" or "refresh"
Device string `json:"device"` // "mobile" or "desktop"
URL string `json:"url"` // URL associated with token issuance
TwoFAEnabled bool `json:"twoFA_enabled"`
TwoFAVerified bool `json:"twoFA_verified"`
jwt.RegisteredClaims
}
Click to show internal directories.
Click to hide internal directories.