Allow the pin to be passed in via the URL
Instead of only prompting the user for a pin, also allow it to be passed in as the URL parameter "pin".
This commit is contained in:
parent
ebc51f938c
commit
e051cade78
|
@ -190,6 +190,14 @@ func checkRoomAccess(w http.ResponseWriter, r *http.Request) bool {
|
||||||
// Pin is incorrect.
|
// Pin is incorrect.
|
||||||
handlePinTemplate(w, r, "Incorrect PIN")
|
handlePinTemplate(w, r, "Incorrect PIN")
|
||||||
return false
|
return false
|
||||||
|
} else {
|
||||||
|
qpin := r.URL.Query().Get("pin")
|
||||||
|
if qpin != "" && qpin == settings.RoomAccessPin {
|
||||||
|
// Pin is correct. Save it to session and return true.
|
||||||
|
session.Values["pin"] = settings.RoomAccessPin
|
||||||
|
session.Save(r, w)
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// nope. display pin entry and return
|
// nope. display pin entry and return
|
||||||
handlePinTemplate(w, r, "")
|
handlePinTemplate(w, r, "")
|
||||||
|
|
Loading…
Reference in New Issue