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",
diff --git a/packet/templates/include/nav.html b/packet/templates/include/nav.html
index 3fd0fe9..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 }}
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