mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
fix: auth service checks
This commit is contained in:
parent
f5edcff24b
commit
da94907913
@ -143,9 +143,15 @@ func (s *APIV1Service) SignInWithSSO(ctx context.Context, request *v1pb.SignInWi
|
||||
}
|
||||
|
||||
func (s *APIV1Service) SignUp(ctx context.Context, request *v1pb.SignUpRequest) (*v1pb.User, error) {
|
||||
if !s.Profile.Public {
|
||||
workspaceSecuritySetting, err := s.Store.GetWorkspaceSecuritySetting(ctx)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get workspace security setting, err: %s", err))
|
||||
}
|
||||
if workspaceSecuritySetting.DisallowUserRegistration {
|
||||
return nil, status.Errorf(codes.PermissionDenied, "sign up is not allowed")
|
||||
}
|
||||
|
||||
// Check if the number of users has reached the maximum.
|
||||
if err := s.checkSeatAvailability(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user