X-Git-Url: https://code.octet-stream.net/broadcaster/blobdiff_plain/546b243565e913a70e174ec80fd903f077fd5277..25d02cf0c3462805176f4193d675c4904221dca1:/server/main.go?ds=sidebyside diff --git a/server/main.go b/server/main.go index 105e858..9f6927e 100644 --- a/server/main.go +++ b/server/main.go @@ -413,7 +413,7 @@ func changePasswordPage(w http.ResponseWriter, r *http.Request, user User) { data.ShowForm = false cookie, err := r.Cookie("broadcast_session") if err == nil { - log.Println("clearing other sessions for username", user.Username, "token", cookie.Value) + log.Println("Clearing other sessions for username", user.Username, "token", cookie.Value) db.ClearOtherSessions(user.Username, cookie.Value) } } @@ -642,7 +642,6 @@ func filesPage(w http.ResponseWriter, _ *http.Request, user User) { data := FilesPageData{ Files: files.Files(), } - log.Println("file page data", data) tmpl := template.Must(template.ParseFS(content, "templates/files.html")) err := tmpl.Execute(w, data) if err != nil { @@ -671,13 +670,17 @@ func uploadFile(w http.ResponseWriter, r *http.Request) { f, _ := os.Create(path) defer f.Close() io.Copy(f, file) - log.Println("uploaded file to", path) + log.Println("Uploaded file to", path) files.Refresh() } http.Redirect(w, r, "/files/", http.StatusFound) } func logOutPage(w http.ResponseWriter, r *http.Request, user User) { + cookie, err := r.Cookie("broadcast_session") + if err == nil { + db.ClearSession(user.Username, cookie.Value) + } clearSessionCookie(w) renderHeader(w, "", user) tmpl := template.Must(template.ParseFS(content, "templates/logout.html"))