add: User transmission interface encryption
This commit is contained in:
@@ -40,6 +40,8 @@ func AuthMiddleware(svc *svc.ServiceContext) func(c *gin.Context) {
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
loginType := claims["LoginType"].(string)
|
||||
// get user id from token
|
||||
userId := int64(claims["UserId"].(float64))
|
||||
// get session id from token
|
||||
@@ -77,6 +79,7 @@ func AuthMiddleware(svc *svc.ServiceContext) func(c *gin.Context) {
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
ctx = context.WithValue(ctx, constant.LoginType, loginType)
|
||||
ctx = context.WithValue(ctx, constant.CtxKeyUser, userInfo)
|
||||
ctx = context.WithValue(ctx, constant.CtxKeySessionID, sessionId)
|
||||
c.Request = c.Request.WithContext(ctx)
|
||||
|
||||
Reference in New Issue
Block a user