CHANGE: finalized user auth + added booking edit view

This commit is contained in:
2025-02-20 01:56:21 +01:00
parent 35778e58b3
commit 8baf2f378a
17 changed files with 852 additions and 572 deletions

View File

@@ -45,7 +45,7 @@ func loginUser(w http.ResponseWriter, r *http.Request){
log.Println("No card_uid provided!")
http.Error(w, "No card_uid provided", http.StatusBadRequest)
}
user, err := (*models.User).GetById(nil, card_uid)
user, err := (*models.User).GetByCardUID(nil, card_uid)
if(err != nil){
log.Println("No user found under this card_uid!")
http.Error(w, "No user found!", http.StatusNotFound)
@@ -54,7 +54,7 @@ func loginUser(w http.ResponseWriter, r *http.Request){
password := r.FormValue("password")
if(user.Login(password)){
log.Printf("New succesfull user login from %s %s!\n", user.Vorname, user.Name)
Session.Put(r.Context(), "user", user.CardUID)
Session.Put(r.Context(), "user", user.PersonalNummer)
http.Redirect(w, r, "/time", http.StatusSeeOther) //with this browser always uses GET
}