Initial commit

This commit is contained in:
Artem Mamonov
2025-02-06 02:36:10 +01:00
commit acf9b43671
24 changed files with 1946 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package controller
import (
"github.com/gin-gonic/gin"
"log"
"photodisk/internal/auth"
)
func SetUser(c *gin.Context, user auth.User) {
c.Set("user", user)
}
func GetUser(c *gin.Context) auth.User {
user, ok := c.Get("user")
if !ok {
log.Fatal("user not found in context")
}
return user.(auth.User)
}