refactor: clean packages

This commit is contained in:
Steven
2025-05-29 21:44:43 +08:00
parent 2bde296217
commit f1b365f928
23 changed files with 38 additions and 31 deletions

View File

@@ -16,6 +16,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
"github.com/usememos/memos/internal/base"
"github.com/usememos/memos/internal/util"
"github.com/usememos/memos/plugin/idp"
"github.com/usememos/memos/plugin/idp/oauth2"
@@ -207,7 +208,7 @@ func (s *APIV1Service) SignUp(ctx context.Context, request *v1pb.SignUpRequest)
Nickname: request.Username,
PasswordHash: string(passwordHash),
}
if !util.UIDMatcher.MatchString(strings.ToLower(create.Username)) {
if !base.UIDMatcher.MatchString(strings.ToLower(create.Username)) {
return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", create.Username)
}