Archived
Template
1
0

Adds godoc comments

This commit is contained in:
uberswe
2022-01-09 14:22:43 +01:00
parent 2d3c0df4e5
commit 8c37faf016
30 changed files with 154 additions and 68 deletions

View File

@ -6,8 +6,10 @@ import (
"net/http"
)
// UserIDKey is the key used to set and get the user id in the context of the current request
const UserIDKey = "UserID"
// Auth middleware redirects to /login and aborts the current request if there is no authenticated user
func Auth() gin.HandlerFunc {
return func(c *gin.Context) {
_, exists := c.Get(UserIDKey)