return error entity when verify email is not enabled

This commit is contained in:
MaysWind
2023-09-10 17:25:23 +08:00
parent 35ac0695c7
commit ca14770971
5 changed files with 15 additions and 0 deletions
+4
View File
@@ -236,6 +236,10 @@ func (l *UserDataCli) DisableUser(c *cli.Context, username string) error {
// ResendVerifyEmail resends an email with account activation link
func (l *UserDataCli) ResendVerifyEmail(c *cli.Context, username string) error {
if !settings.Container.Current.EnableUserVerifyEmail {
return errs.ErrEmailValidationNotAllowed
}
if username == "" {
log.BootErrorf("[user_data.ResendVerifyEmail] user name is empty")
return errs.ErrUsernameIsEmpty