MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / TryUserAuth

Function TryUserAuth

middleware/auth.go:143–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141}
142
143func TryUserAuth() func(c *gin.Context) {
144 return func(c *gin.Context) {
145 session := sessions.Default(c)
146 id := session.Get("id")
147 if id != nil {
148 c.Set("id", id)
149 }
150 c.Next()
151 }
152}
153
154func UserAuth() func(c *gin.Context) {
155 return func(c *gin.Context) {

Callers 1

SetApiRouterFunction · 0.92

Calls 2

GetMethod · 0.80
NextMethod · 0.80

Tested by

no test coverage detected