mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2025-12-30 05:09:44 -06:00
fix: don't allow UserCreate endpoint if no basic auth enabled (#1861)
This commit is contained in:
@@ -16,6 +16,12 @@ import (
|
||||
)
|
||||
|
||||
func (u *UserService) UserCreate(ctx echo.Context, request gen.UserCreateRequestObject) (gen.UserCreateResponseObject, error) {
|
||||
// check that the server supports local registration
|
||||
if !u.config.Auth.ConfigFile.BasicAuthEnabled {
|
||||
return gen.UserCreate405JSONResponse(
|
||||
apierrors.NewAPIErrors("local registration is not enabled"),
|
||||
), nil
|
||||
}
|
||||
|
||||
if !u.config.Runtime.AllowSignup {
|
||||
return gen.UserCreate400JSONResponse(
|
||||
|
||||
Reference in New Issue
Block a user