-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require authentication as 'ref' user to view ref pages #12
base: main
Are you sure you want to change the base?
Conversation
dejabot
commented
Nov 22, 2024
- add ref password to settings
- require either ref or admin authentication in order to access ref pages
@@ -11,6 +11,10 @@ import ( | |||
// through a websockets integration, the head ref will be able to see score updates submitted by other | |||
// refs in realtime. | |||
func (web *Web) headrefDisplayHandler(w http.ResponseWriter, r *http.Request) { | |||
if !web.userIsExpected(w, r, []string{adminUser, refUser}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be some sort of error message returned to the client here? something equivalent to handleWebErr
@@ -41,6 +45,10 @@ func (web *Web) headrefDisplayHandler(w http.ResponseWriter, r *http.Request) { | |||
|
|||
// The websocket endpoint for the ref display client to receive status updates. | |||
func (web *Web) headrefDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) { | |||
if !web.userIsExpected(w, r, []string{adminUser, refUser}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be some sort of error message returned to the client here? something equivalent to handleWebErr
@@ -58,14 +59,24 @@ func (web *Web) renderLogin(w http.ResponseWriter, r *http.Request, errorMessage | |||
} | |||
} | |||
|
|||
func contains(slice []string, expected string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.