mirror of
https://github.com/usememos/memos.git
synced 2025-03-19 12:10:08 +01:00
chore: tweak signup checks
This commit is contained in:
parent
553e8d09dd
commit
c5900b355e
@ -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…
x
Reference in New Issue
Block a user