ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Updating GitHub login was too tricky #1221

Open ctm opened 1 year ago

ctm commented 1 year ago

Remove hardcoded GitHub client ids from lobby.rs

Lobby.rs contains code where the hostname is used to determine which hardcoded GitHub client-id to use. That caused problems for me earlier today when I was fixing a GitHub login issue (#1218). Since we're not bringing up new sites often, I think it's OK to do the hostname matching, but instead having the match resolve to a hardcoded value, at minimum have it be to a descriptive constant that will show up in searches, perhaps with that constant being created at build time using environment variables.

Since the server itself is driven by environment variables, having the server provide that information itself would be more foolproof, albeit at the cost of a round trip to the server. OTOH, once the GitHub button has been pushed there's going to be a lot more activity than just a roundtrip to the server, so that's the way to "do it right".