()
| 141 | } |
| 142 | |
| 143 | func 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 | |
| 154 | func UserAuth() func(c *gin.Context) { |
| 155 | return func(c *gin.Context) { |
no test coverage detected