We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent7a4737c commit956d0cbCopy full SHA for 956d0cb
coderd/users.go
@@ -464,13 +464,20 @@ func (api *API) postUser(rw http.ResponseWriter, r *http.Request) {
464
}
465
loginType=database.LoginTypePassword
466
casecodersdk.LoginTypeOIDC:
467
+ifapi.OIDCConfig==nil {
468
+httpapi.Write(ctx,rw,http.StatusBadRequest, codersdk.Response{
469
+Message:"You must configure OIDC before creating OIDC users.",
470
+})
471
+return
472
+}
473
loginType=database.LoginTypeOIDC
474
casecodersdk.LoginTypeGithub:
475
loginType=database.LoginTypeGithub
476
default:
477
httpapi.Write(ctx,rw,http.StatusBadRequest, codersdk.Response{
478
Message:fmt.Sprintf("Unsupported login type %q for manually creating new users.",req.UserLoginType),
479
})
480
481
482
483
user,_,err:=api.CreateUser(ctx,api.Database,CreateUserRequest{