fix: auth package import twice (#2724)

This commit is contained in:
liangkai 2024-10-15 14:47:34 +08:00 committed by GitHub
parent 3167f9943f
commit e7c7bf3bd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,8 +16,8 @@ package rpcclient
import ( import (
"context" "context"
"github.com/openimsdk/protocol/auth" "github.com/openimsdk/protocol/auth"
pbAuth "github.com/openimsdk/protocol/auth"
"github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/discovery"
"github.com/openimsdk/tools/system/program" "github.com/openimsdk/tools/system/program"
"google.golang.org/grpc" "google.golang.org/grpc"
@ -38,8 +38,8 @@ type Auth struct {
discov discovery.SvcDiscoveryRegistry discov discovery.SvcDiscoveryRegistry
} }
func (a *Auth) ParseToken(ctx context.Context, token string) (*pbAuth.ParseTokenResp, error) { func (a *Auth) ParseToken(ctx context.Context, token string) (*auth.ParseTokenResp, error) {
req := pbAuth.ParseTokenReq{ req := auth.ParseTokenReq{
Token: token, Token: token,
} }
resp, err := a.Client.ParseToken(ctx, &req) resp, err := a.Client.ParseToken(ctx, &req)
@ -49,8 +49,8 @@ func (a *Auth) ParseToken(ctx context.Context, token string) (*pbAuth.ParseToken
return resp, err return resp, err
} }
func (a *Auth) InvalidateToken(ctx context.Context, preservedToken, userID string, platformID int) (*pbAuth.InvalidateTokenResp, error) { func (a *Auth) InvalidateToken(ctx context.Context, preservedToken, userID string, platformID int) (*auth.InvalidateTokenResp, error) {
req := pbAuth.InvalidateTokenReq{ req := auth.InvalidateTokenReq{
PreservedToken: preservedToken, PreservedToken: preservedToken,
UserID: userID, UserID: userID,
PlatformID: int32(platformID), PlatformID: int32(platformID),