mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-13 13:35:59 +08:00
Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release
This commit is contained in:
@@ -56,6 +56,19 @@ func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbA
|
||||
return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}, nil
|
||||
}
|
||||
|
||||
func (rpc *rpcAuth) ParseToken(_ context.Context, req *pbAuth.ParseTokenReq) (*pbAuth.ParseTokenResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String())
|
||||
claims, err := token_verify.ParseToken(req.Token, req.OperationID)
|
||||
if err != nil {
|
||||
errMsg := "ParseToken failed " + err.Error() + req.OperationID + " token " + req.Token
|
||||
log.Error(req.OperationID, errMsg, "token:", req.Token)
|
||||
return &pbAuth.ParseTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: 4001, ErrMsg: errMsg}}, nil
|
||||
}
|
||||
resp := pbAuth.ParseTokenResp{CommonResp: &pbAuth.CommonResp{}, UserID: claims.UID, Platform: claims.Platform, ExpireTimeSeconds: uint32(claims.ExpiresAt.Unix())}
|
||||
log.Info(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp.String())
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func (rpc *rpcAuth) ForceLogout(_ context.Context, req *pbAuth.ForceLogoutReq) (*pbAuth.ForceLogoutResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String())
|
||||
if !token_verify.IsManagerUserID(req.OpUserID) {
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
package auth
|
||||
@@ -933,6 +933,7 @@ func Notification(n *NotificationMsg) {
|
||||
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), reply.ErrCode, reply.ErrMsg)
|
||||
}
|
||||
}
|
||||
|
||||
func getOnlineAndOfflineUserIDList(memberList []string, m map[string][]string, operationID string) {
|
||||
var onllUserIDList, offlUserIDList []string
|
||||
var wsResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult
|
||||
|
||||
Reference in New Issue
Block a user