small fixes and refactoring
This commit is contained in:
@@ -29,8 +29,9 @@ func autoLogout(w http.ResponseWriter) {
|
||||
err = user.Logout()
|
||||
if err != nil {
|
||||
fmt.Printf("Error logging out user %v\n", err)
|
||||
}
|
||||
}else {
|
||||
logged_out_users = append(logged_out_users, user)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ func updateBooking(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("Error getting booking!", err)
|
||||
continue
|
||||
}
|
||||
parsedTime, err := time.ParseInLocation("15:04", possibleBooking[0], time.Local)
|
||||
parsedTime, err := time.ParseInLocation("15:04", possibleBooking[0], booking.Timestamp.Location())
|
||||
if err != nil {
|
||||
log.Println("Error parsing time!", err)
|
||||
continue
|
||||
|
||||
@@ -69,6 +69,5 @@ func checkPassword(r *http.Request) bool {
|
||||
return false
|
||||
}
|
||||
}
|
||||
log.Println(authHeaders)
|
||||
return authToken == authHeaders[_authStart:]
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ func LoginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
func UserHandler(w http.ResponseWriter, r *http.Request) {
|
||||
func UserSettingsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
helper.RequiresLogin(Session, w, r)
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
|
||||
Reference in New Issue
Block a user