mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2024-11-17 01:17:37 +00:00
19 lines
319 B
Go
19 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()
|
||
|
}
|