mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: allow creating manual oidc/github based users (#9000)
* feat: allow creating manual oidc/github based users * Add unit test for oidc and no login type create
This commit is contained in:
@@ -28,6 +28,7 @@ type APIKey struct {
|
||||
type LoginType string
|
||||
|
||||
const (
|
||||
LoginTypeUnknown LoginType = ""
|
||||
LoginTypePassword LoginType = "password"
|
||||
LoginTypeGithub LoginType = "github"
|
||||
LoginTypeOIDC LoginType = "oidc"
|
||||
|
||||
+4
-1
@@ -78,9 +78,12 @@ type CreateFirstUserResponse struct {
|
||||
type CreateUserRequest struct {
|
||||
Email string `json:"email" validate:"required,email" format:"email"`
|
||||
Username string `json:"username" validate:"required,username"`
|
||||
Password string `json:"password" validate:"required_if=DisableLogin false"`
|
||||
Password string `json:"password"`
|
||||
// UserLoginType defaults to LoginTypePassword.
|
||||
UserLoginType LoginType `json:"login_type"`
|
||||
// DisableLogin sets the user's login type to 'none'. This prevents the user
|
||||
// from being able to use a password or any other authentication method to login.
|
||||
// Deprecated: Set UserLoginType=LoginTypeDisabled instead.
|
||||
DisableLogin bool `json:"disable_login"`
|
||||
OrganizationID uuid.UUID `json:"organization_id" validate:"" format:"uuid"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user