mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2025-01-09 20:39:57 +00:00
18 lines
319 B
Go
18 lines
319 B
Go
package handler
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func CookieProtected(c *fiber.Ctx) error {
|
|
cookie := c.Cookies("xmr-nodes-ui")
|
|
if cookie == "" {
|
|
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
|
"status": "error",
|
|
"message": "Unauthorized",
|
|
"data": nil,
|
|
})
|
|
}
|
|
|
|
return c.Next()
|
|
}
|