MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / CheckSession

Method CheckSession

utils/jwt/jwt.go:174–186  ·  view source on GitHub ↗

CheckSession 检查会话状态

(ctx *gin.Context, ssid string)

Source from the content-addressed store, hash-verified

172
173// CheckSession 检查会话状态
174func (h *handler) CheckSession(ctx *gin.Context, ssid string) error {
175 // 判断缓存中是否存在指定键
176 c, err := h.client.Exists(ctx, fmt.Sprintf("linkme:user:ssid:%s", ssid)).Result()
177 if err != nil {
178 return err
179 }
180
181 if c != 0 {
182 return errors.New("token失效")
183 }
184
185 return nil
186}
187
188// ClearToken 清空token
189func (h *handler) ClearToken(ctx *gin.Context) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected