Show registration unavailable page when signup is disabled

Instead of showing the signup form and returning an internal error on
submit, the SignUpPage now queries signUpEnabled upfront and displays a
friendly message explaining that registration is not available, with a
link back to login.

Adds a signUpEnabled GraphQL query field on the connect/v1 API and
handles ErrSignupDisabled as a FORBIDDEN error in the SignUp resolver.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-04-08 18:29:36 +02:00
parent ab5f42ad74
commit 76f6c8f9d1
4 changed files with 64 additions and 2 deletions

View File

@@ -188,6 +188,10 @@ func NewService(
return svc, nil
}
func (s *Service) IsSignUpEnabled() bool {
return !s.disableSignup
}
func (s *Service) Run(ctx context.Context) error {
wg := sync.WaitGroup{}
ctx, cancel := context.WithCancelCause(ctx)