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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user