From 9a31439acad21ddd9c2327f0c3ad1bdb452e98d2 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Sat, 22 Jul 2023 09:55:10 +0200 Subject: [PATCH] Factoring the model user and correcting password --- profile.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/profile.go b/profile.go index 38bea75..5484583 100644 --- a/profile.go +++ b/profile.go @@ -64,14 +64,15 @@ func handleProfile(w http.ResponseWriter, r *http.Request) { data.Success = true } } else { - user, _ = get(User{ - DN: login.Info.DN - }, config, login.conn) - data.DisplayName = user.DisplayName - data.GivenName = user.GivenName - data.Surname = user.SN - data.Description = user.Description - data.Mail = user.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 } /*