feat(user): add ENV to control DISABLE_USER_REGISTRATION and ALLOW_REGISTRATION_EMAIL (#208)
This commit is contained in:
@@ -112,3 +112,8 @@ const (
|
||||
ApplyUploadActionURI = "/api/common/upload/apply_upload_action"
|
||||
UploadURI = "/api/common/upload"
|
||||
)
|
||||
|
||||
const (
|
||||
DisableUserRegistration = "DISABLE_USER_REGISTRATION"
|
||||
AllowRegistrationEmail = "ALLOW_REGISTRATION_EMAIL"
|
||||
)
|
||||
|
||||
@@ -31,9 +31,17 @@ const (
|
||||
ErrUserResourceNotFound = 700000005
|
||||
ErrUserInvalidParamCode = 700000006
|
||||
ErrUserPermissionCode = 700000007
|
||||
ErrNotAllowedRegisterCode = 700000008
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
code.Register(
|
||||
ErrNotAllowedRegisterCode,
|
||||
"The user registration has been disabled by the administrator. Please contact the administrator!",
|
||||
code.WithAffectStability(false),
|
||||
)
|
||||
|
||||
code.Register(
|
||||
ErrUserPermissionCode,
|
||||
"unauthorized access : {msg}",
|
||||
|
||||
Reference in New Issue
Block a user