From 15ea276899e6794d7e98572dfb17d83681a45b80 Mon Sep 17 00:00:00 2001
From: Mitchell Moore <mmoo97@uab.edu>
Date: Thu, 14 May 2020 13:57:52 -0400
Subject: [PATCH] Add backend todo to pull values

---
 app/__init__.py                | 14 ++++++++++++++
 app/static/scripts/function.js |  3 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/app/__init__.py b/app/__init__.py
index c30a7f1..b9a23d5 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -21,6 +21,18 @@ def create_app(config_name):
         if 'uid' not in session:
             session['uid']=str(uuid.uuid4())
 
+        if 'bid' not in session:
+            # Todo get blazerid from Shib/BasicAuth
+            pass
+
+        if 'fullname' not in session:
+            # Todo get fullname from Shib/BasicAuth
+            pass
+
+        if 'email' not in session:
+            # Todo get email from Shib/BasicAuth
+            pass
+
         if "redir" in request.args and 'return_url' not in session: # check for redir arg in url
             session['return_url'] = request.args.get("redir")
         elif "redir" not in request.args and 'return_url' not in session:
@@ -28,6 +40,8 @@ def create_app(config_name):
         else:
             session['return_url'] = request.referrer
 
+        # return render_template('auth/SignUp.html', room_id=session['uid'], username=session['username'], fullname=session['fullname'],
+        #                        email=session['email'], referrer=session['return_url'])
         return render_template('auth/SignUp.html', room_id=session['uid'], referrer=session['return_url'])
 
     # misc page error catching
diff --git a/app/static/scripts/function.js b/app/static/scripts/function.js
index 694ff19..973ca63 100644
--- a/app/static/scripts/function.js
+++ b/app/static/scripts/function.js
@@ -4,9 +4,10 @@ function displayloading() {
 
 function request_account() {
     socket.emit('request account', {
+        username: document.getElementById("username").value,
         fullname: document.getElementById("fullname").value,
         reason: document.getElementById("reason").value,
-        username: document.getElementById("bid").value
+        email: document.getElementById("email").value
     })
 }
 
-- 
GitLab