diff --git a/coderd/users.go b/coderd/users.go index 565aeca1cb2a8..bfa81f86624e4 100644 --- a/coderd/users.go +++ b/coderd/users.go @@ -464,6 +464,12 @@ func (api *API) postUser(rw http.ResponseWriter, r *http.Request) { } loginType = database.LoginTypePassword case codersdk.LoginTypeOIDC: + if api.OIDCConfig == nil { + httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ + Message: "You must configure OIDC before creating OIDC users.", + }) + return + } loginType = database.LoginTypeOIDC case codersdk.LoginTypeGithub: loginType = database.LoginTypeGithub @@ -471,6 +477,7 @@ func (api *API) postUser(rw http.ResponseWriter, r *http.Request) { httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ Message: fmt.Sprintf("Unsupported login type %q for manually creating new users.", req.UserLoginType), }) + return } user, _, err := api.CreateUser(ctx, api.Database, CreateUserRequest{ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy