From: Carl Worth Date: Thu, 21 May 2020 16:13:11 +0000 (-0700) Subject: Add a simple /stats endpoint to get a count of current games in progress X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=733fd82de5d0448649f769af5850ad6cc528f0d5;hp=733fd82de5d0448649f769af5850ad6cc528f0d5;p=lmno-server Add a simple /stats endpoint to get a count of current games in progress This view is particularly spartan so far, (just two lines of next, not even HTML). Most of the work in this commit is actually setting up the authentication mechanism, since /stats is the first page we have that requires a user to be authenticated (and to also have the "admin" role). We have a nice-looking "/login" page with proper styling and clean messages for login failure. If an unauthenticated user goes to /stats they will be sent to /login?next=/stats and after successfully authenticating, will be sent back to /stats (this time getting the spartan view of the game statistics). There is another set of pages that is more minmal than we really want. This is all in the area of user that successfully authenticates but doesn't have the "admin" role. I'm ignoring all of these issues for now because I'm not going to actually configure any such users. But here are the issues: * If a user without the admin role hits /stats they they will get a correct 401 status, but a very spartan page (just the word "Unauthorized" as plain text). * In that case, if the user wants to logout there are no links provided to do that. * There _is_ a page at /logout which does do a correct logout, but again returns a very spartan, plain-text message that you are logged out. ---