From 42c22101780bd813d98c70e2447dfea1d3749e74 Mon Sep 17 00:00:00 2001 From: Yixiang Zhao Date: Mon, 30 May 2022 18:26:42 +0800 Subject: [PATCH] fix: set phone prefix when disable verification code (#769) Signed-off-by: Yixiang Zhao --- controllers/auth.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/auth.go b/controllers/auth.go index 53af2bd8..6bae47d4 100644 --- a/controllers/auth.go +++ b/controllers/auth.go @@ -222,7 +222,11 @@ func (c *ApiController) Login() { } // disable the verification code - object.DisableVerificationCode(form.Username) + if strings.Contains(form.Username, "@") { + object.DisableVerificationCode(form.Username) + } else { + object.DisableVerificationCode(fmt.Sprintf("+%s%s", form.PhonePrefix, form.Username)) + } user = object.GetUserByFields(form.Organization, form.Username) if user == nil {