Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CsrfMiddleware = csrf.New(csrf.Config{ KeyLookup: "header:X-Csrf-Token", CookieName: "csrf_", CookieSameSite: "Lax", Expiration: 1 * time.Hour, KeyGenerator: utils.UUIDv4, ErrorHandler: func(c fiber.Ctx, err error) error { if err.Error() == "forbidden" { c.Cookie(&fiber.Cookie{ Name: "csrf_", Value: "", Expires: time.Now().Add(-1 * time.Hour), SameSite: "Lax", }) } return c.Status(fiber.StatusForbidden).JSON(fiber.Map{ "error": "CSRF token is invalid or missing", }) }, })
View Source
var UserSessionStore *session.Store
Functions ¶
func CreateRouter ¶
func CreateRouter(app fiber.Router)
func CreateSessionStore ¶
func CreateSessionStore()
func GetUsername ¶
func IsAuthenticated ¶
func IsAuthenticated(c fiber.Ctx) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.