Browse Source

Remove the /pin endpoint

This was never supposed to be in there.
pull/1/head
Zorchenhimer 2 years ago
parent
commit
ebc51f938c
  1. 22
      handlers.go
  2. 1
      main.go

22
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) {

1
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)

Loading…
Cancel
Save