From 0ffa7a155a8ca20aa8b3cff84b913f037cc37105 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Sat, 22 Jul 2023 10:10:30 +0200 Subject: [PATCH] Factoring the model user and correcting password --- profile.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/profile.go b/profile.go index 6b73b60..0119bcc 100644 --- a/profile.go +++ b/profile.go @@ -63,17 +63,16 @@ func handleProfile(w http.ResponseWriter, r *http.Request) { } else { data.Success = true } - } else { - findUser, err := get(user, config, login.conn) - if err != nil { - data.ErrorMessage = "handleProfile : " + err.Error() - } - data.DisplayName = findUser.DisplayName - data.GivenName = findUser.GivenName - data.Surname = findUser.SN - data.Description = findUser.Description - data.Mail = findUser.Mail } + findUser, err := get(user, config, login.conn) + if err != nil { + data.ErrorMessage = "handleProfile : " + err.Error() + } + data.DisplayName = findUser.DisplayName + data.GivenName = findUser.GivenName + data.Surname = findUser.SN + data.Description = findUser.Description + data.Mail = findUser.Mail /* visible := strings.TrimSpace(strings.Join(r.Form["visibility"], ""))