From 5ff71dfd65e32fdf82a934409d18fe4369d11a05 Mon Sep 17 00:00:00 2001
From: mroley1 <64291507+mroley1@users.noreply.github.com>
Date: Wed, 24 Aug 2022 20:04:30 -0400
Subject: [PATCH 1/4] added catch for intro members w/o profile in nav
---
packet/templates/include/nav.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packet/templates/include/nav.html b/packet/templates/include/nav.html
index 3fd0fe9..a421e98 100644
--- a/packet/templates/include/nav.html
+++ b/packet/templates/include/nav.html
@@ -41,7 +41,7 @@
-
+
{{ info.uid }}
From 78794b01c22814d434a7562749f26d2e4eb9e655 Mon Sep 17 00:00:00 2001
From: mroley1 <64291507+mroley1@users.noreply.github.com>
Date: Thu, 25 Aug 2022 10:44:07 -0400
Subject: [PATCH 2/4] facied up nav user profile logic
---
packet/templates/include/nav.html | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packet/templates/include/nav.html b/packet/templates/include/nav.html
index a421e98..6573b8b 100644
--- a/packet/templates/include/nav.html
+++ b/packet/templates/include/nav.html
@@ -41,7 +41,11 @@
-
+ {% if info.realm == "csh" %}
+
+ {% else %}
+
+ {% endif %}
{{ info.uid }}
From c12d91acddcc8047a84eba5a9e11d4d3247412a9 Mon Sep 17 00:00:00 2001
From: Galen Guyer
Date: Thu, 25 Aug 2022 15:48:37 -0400
Subject: [PATCH 3/4] Redirect to the configured host before OIDC if incorrect
---
packet/utils.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/packet/utils.py b/packet/utils.py
index 75c9802..a6e9158 100644
--- a/packet/utils.py
+++ b/packet/utils.py
@@ -4,9 +4,10 @@
from datetime import datetime, time, timedelta, date
from functools import wraps, lru_cache
from typing import Any, Callable, TypeVar, cast
+from urllib.parse import urlparse
import requests
-from flask import session, redirect
+from flask import session, redirect, request
from packet import auth, app, db, ldap
from packet.mail import send_start_packet_mail
@@ -64,6 +65,16 @@ def is_freshman_on_floor(rit_username: str) -> bool:
return False
+@app.before_request
+def before_reqest_callback() -> Any:
+ """
+ Pre-request function to ensure we're on the right URL before OIDC sees anything
+ """
+ if urlparse(request.base_url).hostname != app.config['SERVER_NAME']:
+ return redirect(request.base_url.replace(urlparse(request.base_url).hostname,
+ app.config['SERVER_NAME']), code=302)
+ return None
+
def packet_auth(func: WrappedFunc) -> WrappedFunc:
"""
Decorator for easily configuring oidc
From e5761dc7d331e0b39ae9bbd6e29acd078438baeb Mon Sep 17 00:00:00 2001
From: Galen Guyer
Date: Thu, 25 Aug 2022 16:59:58 -0400
Subject: [PATCH 4/4] Bump to 3.5.7
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0550e4f..1a283db 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"title": "CSH Packet",
"name": "csh-packet",
- "version": "3.5.6",
+ "version": "3.5.7",
"description": "A web app implementation of the CSH introductory packet.",
"bugs": {
"url": "https://github.com/ComputerScienceHouse/packet/issues",