Remove the /pin endpoint
This was never supposed to be in there.
This commit is contained in:
parent
58bd6e8a3a
commit
ebc51f938c
22
handlers.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
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…
Reference in New Issue