From 8a5539a143cbdafe723349f5cee3181217daa5ca Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Fri, 21 Jul 2023 10:22:23 +0200 Subject: [PATCH] Implementing Activate User --- login.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/login.go b/login.go index fab4fcb..5515b3b 100644 --- a/login.go +++ b/login.go @@ -213,15 +213,16 @@ func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo { if strings.EqualFold(username, config.AdminAccount) { user_dn = username } - loginInfo := *doLogin(w, r, username, user_dn, password) + loginInfo := doLogin(w, r, username, user_dn, password) return &loginInfo + } else { http.Error(w, "Unsupported method", http.StatusBadRequest) return nil } } -func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn string, password string) *LoginInfo { +func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn string, password string) LoginInfo { l := ldapOpen(w) if l == nil { return nil @@ -260,7 +261,7 @@ func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn st return nil } - return &LoginInfo{ + return LoginInfo{ DN: user_dn, Username: username, Password: password,