File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"title" : " CSH Packet" ,
3
3
"name" : " csh-packet" ,
4
- "version" : " 3.5.6 " ,
4
+ "version" : " 3.5.7 " ,
5
5
"description" : " A web app implementation of the CSH introductory packet." ,
6
6
"bugs" : {
7
7
"url" : " https://github.com/ComputerScienceHouse/packet/issues" ,
Original file line number Diff line number Diff line change 41
41
< li class ="navbar-user dropdown ">
42
42
43
43
< a class ="nav-link dropdown-toggle " data-toggle ="dropdown " href ="# " id ="user01 ">
44
+ {% if info.realm == "csh" %}
44
45
< img src ="https://profiles.csh.rit.edu/image/{{ info.uid }} ">
46
+ {% else %}
47
+ < img src ="{{ get_rit_image(info.uid) }} ">
48
+ {% endif %}
45
49
{{ info.uid }}
46
50
< span class ="caret "> </ span >
47
51
</ a >
Original file line number Diff line number Diff line change 4
4
from datetime import datetime , time , timedelta , date
5
5
from functools import wraps , lru_cache
6
6
from typing import Any , Callable , TypeVar , cast
7
+ from urllib .parse import urlparse
7
8
8
9
import requests
9
- from flask import session , redirect
10
+ from flask import session , redirect , request
10
11
11
12
from packet import auth , app , db , ldap
12
13
from packet .mail import send_start_packet_mail
@@ -64,6 +65,16 @@ def is_freshman_on_floor(rit_username: str) -> bool:
64
65
return False
65
66
66
67
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
+
67
78
def packet_auth (func : WrappedFunc ) -> WrappedFunc :
68
79
"""
69
80
Decorator for easily configuring oidc
You can’t perform that action at this time.
0 commit comments