MCPcopy Create free account
hub / github.com/gogs/gogs / CreateUser

Method CreateUser

internal/context/auth.go:125–125  ·  view source on GitHub ↗

CreateUser creates a new user and persists to database. It returns database.ErrNameNotAllowed if the given name or pattern of the name is not allowed as a username, or database.ErrUserAlreadyExist when a user with same name already exists, or database.ErrEmailAlreadyUsed if the email has been verifi

(ctx context.Context, username, email string, opts database.CreateUserOptions)

Source from the content-addressed store, hash-verified

123 // name already exists, or database.ErrEmailAlreadyUsed if the email has been
124 // verified by another user.
125 CreateUser(ctx context.Context, username, email string, opts database.CreateUserOptions) (*database.User, error)
126 // AuthenticateUser validates username and password via given login source ID.
127 // It returns database.ErrUserNotExist when the user was not found.
128 //

Callers 1

authenticatedUserFunction · 0.65

Implementers 4

storeinternal/context/store.go
MockStoreinternal/route/lfs/mocks_test.go
storeinternal/route/lfs/store.go
storeinternal/route/repo/store.go

Calls

no outgoing calls

Tested by

no test coverage detected