From ebc51f938ce63610287601605ec8ce8f93753865 Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Sun, 10 Jan 2021 20:06:48 -0500 Subject: [PATCH] Remove the /pin endpoint This was never supposed to be in there. --- handlers.go | 22 ---------------------- main.go | 1 - 2 files changed, 23 deletions(-) diff --git a/handlers.go b/handlers.go index 3c80f1a..3b86a53 100644 --- a/handlers.go +++ b/handlers.go @@ -2,7 +2,6 @@ package main import ( "encoding/json" - "fmt" "io" "net/http" "path" @@ -290,27 +289,6 @@ func handleEmoteTemplate(w http.ResponseWriter, r *http.Request) { } } -func handlePin(w http.ResponseWriter, r *http.Request) { - session, err := sstore.Get(r, "moviesession") - if err != nil { - common.LogDebugf("Unable to get session: %v\n", err) - } - - val := session.Values["pin"] - if val == nil { - session.Values["pin"] = "1234" - err := session.Save(r, w) - if err != nil { - fmt.Fprintf(w, "unable to save session: %v", err) - } - fmt.Fprint(w, "Pin was not set") - common.LogDebugln("pin was not set") - } else { - fmt.Fprintf(w, "pin set: %v", val) - common.LogDebugf("pin is set: %v\n", val) - } -} - func handleIndexTemplate(w http.ResponseWriter, r *http.Request) { if settings.RoomAccess != AccessOpen { if !checkRoomAccess(w, r) { diff --git a/main.go b/main.go index b598480..2c585d5 100644 --- a/main.go +++ b/main.go @@ -143,7 +143,6 @@ func startServer() { http.HandleFunc("/chat", handleIndexTemplate) http.HandleFunc("/video", handleIndexTemplate) http.HandleFunc("/help", handleHelpTemplate) - http.HandleFunc("/pin", handlePin) http.HandleFunc("/emotes", handleEmoteTemplate) http.HandleFunc("/", handleDefault)