mirror of
https://github.com/usememos/memos.git
synced 2025-10-09 13:56:40 +08:00
chore: tweak signup checks
This commit is contained in:
parent
553e8d09dd
commit
c5900b355e
1 changed files with 5 additions and 1 deletions
|
@ -167,7 +167,11 @@ func (s *APIV1Service) doSignIn(ctx context.Context, user *store.User, expireTim
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *APIV1Service) SignUp(ctx context.Context, request *v1pb.SignUpRequest) (*v1pb.User, error) {
|
func (s *APIV1Service) SignUp(ctx context.Context, request *v1pb.SignUpRequest) (*v1pb.User, error) {
|
||||||
if !s.Profile.Public {
|
workspaceProfile, err := s.GetWorkspaceProfile(ctx, &v1pb.GetWorkspaceProfileRequest{})
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get workspace profile, err: %s", err))
|
||||||
|
}
|
||||||
|
if !workspaceProfile.Public {
|
||||||
return nil, status.Errorf(codes.PermissionDenied, "sign up is not allowed")
|
return nil, status.Errorf(codes.PermissionDenied, "sign up is not allowed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue