From 9a16aa7478b911c2556873697346182520d86c41 Mon Sep 17 00:00:00 2001 From: John Piaszynski Date: Sat, 23 Sep 2023 15:35:17 -0500 Subject: [PATCH] checks user sign in before allowing buying/bidding --- frontend/buy.html | 18 +++++++++++++++++- frontend/index.html | 13 +++++++------ frontend/script.js | 15 +++++++++++++++ frontend/signin.html | 4 ++-- frontend/signup.html | 4 ++-- 5 files changed, 43 insertions(+), 11 deletions(-) diff --git a/frontend/buy.html b/frontend/buy.html index 516c79d..1927fac 100644 --- a/frontend/buy.html +++ b/frontend/buy.html @@ -28,7 +28,23 @@
-
Iowa Vs Western Michigan
+
+ + +
Sat Sep 30, Time TBD ยท Kinnick Stadium, Iowa City, Iowa


diff --git a/frontend/index.html b/frontend/index.html index 2874e87..b6a9e1c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,11 +1,12 @@ - + SeatStock - + + @@ -46,7 +47,7 @@
Iowa Vs. Michigan St

- Buy $55 or Bid + + Sell
Market Data
@@ -68,7 +69,7 @@
Iowa Vs. Minnesota
- + Sell

Market Data @@ -76,7 +77,7 @@
Iowa Vs Rutgers
- + Sell

Market Data
diff --git a/frontend/script.js b/frontend/script.js index e69de29..9ce9a4a 100644 --- a/frontend/script.js +++ b/frontend/script.js @@ -0,0 +1,15 @@ +let USER_SIGNED_IN = false; + +function check_sign_in(game) { + const is_user_signed_in = localStorage.getItem("USER_SIGNED_IN"); + + if (is_user_signed_in !== null && is_user_signed_in === 'true') { + window.location.href = "./buy.html?game=" + game; + } else { + window.location.href = "./signin.html"; + } +} + +function set_user_signed_in() { + localStorage.setItem('USER_SIGNED_IN', true); +} \ No newline at end of file diff --git a/frontend/signin.html b/frontend/signin.html index d34f4ce..4bc8613 100644 --- a/frontend/signin.html +++ b/frontend/signin.html @@ -27,7 +27,7 @@