Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,28 +22,22 @@ def jwtDecode(token):
|
|
| 22 |
except jwt.exceptions.InvalidTokenError:
|
| 23 |
return "bad", "Username/Password does not match"
|
| 24 |
|
| 25 |
-
def
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
session.pop("password", None)
|
| 29 |
-
def wrap():
|
| 30 |
-
if not "username" in session:
|
| 31 |
-
wipe()
|
| 32 |
-
return redirect(url_for("login"))
|
| 33 |
-
if not "password" in session:
|
| 34 |
-
wipe()
|
| 35 |
-
return redirect(url_for("login"))
|
| 36 |
-
return func()
|
| 37 |
-
return wrap()
|
| 38 |
-
|
| 39 |
|
| 40 |
@app.route("/")
|
| 41 |
def index():
|
| 42 |
return render_template("index.html")
|
| 43 |
|
| 44 |
@app.route("/app")
|
| 45 |
-
@authorized
|
| 46 |
def interApp():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
return "<h1>WIP</h1>"
|
| 48 |
|
| 49 |
@app.route("/signup")
|
|
|
|
| 22 |
except jwt.exceptions.InvalidTokenError:
|
| 23 |
return "bad", "Username/Password does not match"
|
| 24 |
|
| 25 |
+
def wipeSession():
|
| 26 |
+
session.pop("username", None)
|
| 27 |
+
session.pop("password", None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
@app.route("/")
|
| 30 |
def index():
|
| 31 |
return render_template("index.html")
|
| 32 |
|
| 33 |
@app.route("/app")
|
|
|
|
| 34 |
def interApp():
|
| 35 |
+
if "username" not in session:
|
| 36 |
+
wipeSession()
|
| 37 |
+
return redirect(url_for("login"))
|
| 38 |
+
if "password" not in session:
|
| 39 |
+
wipeSession()
|
| 40 |
+
return redirect(url_for("login"))
|
| 41 |
return "<h1>WIP</h1>"
|
| 42 |
|
| 43 |
@app.route("/signup")
|