scouting: Re-authorize users when their auth expires
A few students noted at the San Francisco regional that they get 401
errors when trying to submit scouting data. I'm not entirely convinced
how to fix that, but this patch attempts to implement a work around.
Whenever a user tries to submit data, we check for the resulting
status code. If the code is 401, then the app now opens a new tab in
an attempt to re-authorize. The tab will close itself. When the tab
closes, the app will attempt to submit the scouting data again.
Change-Id: I3a4273c9c0f571f68332877f744c9c7013a7e66a
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
diff --git a/WORKSPACE b/WORKSPACE
index f68d1b0..253cba7 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -922,6 +922,7 @@
"@//scouting/www/rpc:package.json",
"@//scouting/www/scan:package.json",
"@//scouting/www/shift_schedule:package.json",
+ "@//scouting/www/test/authorize:package.json",
"@//scouting/www/view:package.json",
],
@@ -1037,6 +1038,20 @@
)
http_archive(
+ name = "chromedriver_linux",
+ build_file_content = """
+filegroup(
+ name = "chromedriver",
+ srcs = ["chromedriver-linux64/chromedriver"],
+ visibility = ["//visibility:public"],
+)""",
+ sha256 = "527b81f8aaf94344af4103c1166ce5e65037e7ad071c773fe354c215d547ef73",
+ urls = [
+ "https://storage.googleapis.com/chrome-for-testing-public/124.0.6367.8/linux64/chromedriver-linux64.zip",
+ ],
+)
+
+http_archive(
name = "rules_rust_tinyjson",
build_file = "@rules_rust//util/process_wrapper:BUILD.tinyjson.bazel",
sha256 = "1a8304da9f9370f6a6f9020b7903b044aa9ce3470f300a1fba5bc77c78145a16",