16 lines
313 B
Go
16 lines
313 B
Go
package handlers_auth
|
|
|
|
import (
|
|
"brunel/auth"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func IsLoggedIn(c *fiber.Ctx) error {
|
|
ok, _ := auth.CheckSessionToken(c.Cookies("pt"))
|
|
if !ok {
|
|
return c.Status(fiber.StatusUnauthorized).SendString("Unauthorized")
|
|
}
|
|
return c.Status(fiber.StatusOK).SendString("Logged in")
|
|
}
|