File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "title" : " CSH Packet" ,
33 "name" : " csh-packet" ,
4- "version" : " 3.5.6 " ,
4+ "version" : " 3.5.7 " ,
55 "description" : " A web app implementation of the CSH introductory packet." ,
66 "bugs" : {
77 "url" : " https://github.com/ComputerScienceHouse/packet/issues" ,
Original file line number Diff line number Diff line change 4141 < li class ="navbar-user dropdown ">
4242
4343 < a class ="nav-link dropdown-toggle " data-toggle ="dropdown " href ="# " id ="user01 ">
44+ {% if info.realm == "csh" %}
4445 < img src ="https://profiles.csh.rit.edu/image/{{ info.uid }} ">
46+ {% else %}
47+ < img src ="{{ get_rit_image(info.uid) }} ">
48+ {% endif %}
4549 {{ info.uid }}
4650 < span class ="caret "> </ span >
4751 </ a >
Original file line number Diff line number Diff line change 44from datetime import datetime , time , timedelta , date
55from functools import wraps , lru_cache
66from typing import Any , Callable , TypeVar , cast
7+ from urllib .parse import urlparse
78
89import requests
9- from flask import session , redirect
10+ from flask import session , redirect , request
1011
1112from packet import auth , app , db , ldap
1213from packet .mail import send_start_packet_mail
@@ -64,6 +65,16 @@ def is_freshman_on_floor(rit_username: str) -> bool:
6465 return False
6566
6667
68+ @app .before_request
69+ def before_reqest_callback () -> Any :
70+ """
71+ Pre-request function to ensure we're on the right URL before OIDC sees anything
72+ """
73+ if urlparse (request .base_url ).hostname != app .config ['SERVER_NAME' ]:
74+ return redirect (request .base_url .replace (urlparse (request .base_url ).hostname ,
75+ app .config ['SERVER_NAME' ]), code = 302 )
76+ return None
77+
6778def packet_auth (func : WrappedFunc ) -> WrappedFunc :
6879 """
6980 Decorator for easily configuring oidc
You can’t perform that action at this time.
0 commit comments