fix: token update

Signed-off-by: Gordon <1432970085@qq.com>
This commit is contained in:
Gordon
2023-07-26 17:51:55 +08:00
parent ac14dd0249
commit 49220ccfbf
15 changed files with 46 additions and 39 deletions
+2 -2
View File
@@ -18,13 +18,13 @@ import (
"context"
"errors"
"fmt"
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
"strings"
"unicode/utf8"
"github.com/OpenIMSDK/protocol/third"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/tools/mcontext"
"github.com/OpenIMSDK/tools/tokenverify"
)
func toPbMapArray(m map[string][]string) []*third.KeyValues {
@@ -52,7 +52,7 @@ func checkUploadName(ctx context.Context, name string) error {
if opUserID == "" {
return errs.ErrNoPermission.Wrap("opUserID is empty")
}
if !tokenverify.IsManagerUserID(opUserID) {
if !authverify.IsManagerUserID(opUserID) {
if !strings.HasPrefix(name, opUserID+"/") {
return errs.ErrNoPermission.Wrap(fmt.Sprintf("name must start with `%s/`", opUserID))
}