log user login standard

This commit is contained in:
stryan 2021-03-31 16:18:02 -04:00
parent 9be48a061e
commit 79f8b40a3d

View File

@ -71,7 +71,6 @@ func signup(res http.ResponseWriter, req *http.Request) {
func login(res http.ResponseWriter, req *http.Request) { func login(res http.ResponseWriter, req *http.Request) {
username := strings.ToLower(req.FormValue("username")) username := strings.ToLower(req.FormValue("username"))
password := req.FormValue("password") password := req.FormValue("password")
log.Printf("Attempting login for user %v\n", username)
err := loginLDAPAccount(username, password) err := loginLDAPAccount(username, password)
if err != nil { if err != nil {
log.Printf("Error logging in user %v: %v\n", username, err) log.Printf("Error logging in user %v: %v\n", username, err)
@ -79,6 +78,7 @@ func login(res http.ResponseWriter, req *http.Request) {
return return
} else { } else {
setSession(username, res) setSession(username, res)
log.Printf("Succesful logging in user %v\n", username)
http.Redirect(res, req, "/", 302) http.Redirect(res, req, "/", 302)
return return
} }