Browse Source

add a util file to host random methods that don't fit anywhere else

master
Stephanie Gredell 1 year ago
parent
commit
80c513265e
  1. 12
      utils/util.go

12
utils/util.go

@ -0,0 +1,12 @@
package utils
import "github.com/gin-gonic/gin"
func CheckIfLoggedIn(c *gin.Context) bool {
userID, err := c.Cookie("user_id")
if err != nil || userID == "" {
return false
}
return true
}
Loading…
Cancel
Save