Skip to content

Commit

Permalink
Hotfix for new USTC CAS system
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Jan 15, 2025
1 parent ee6c1d2 commit 5fce378
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/auth_providers/ustc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def check_ticket(self) -> Optional[ElementTree.Element]:
tree = super().check_ticket()
if not tree:
return None
self.identity = tree.find('attributes').find(self.YALE_CAS_URL + 'gid').text.strip()
self.identity = tree.find(self.YALE_CAS_URL + 'attributes').find(self.YALE_CAS_URL + 'gid').text.strip()
if not self.identity:
# compatibility with old ustc cas
self.identity = tree.find('attributes').find(self.YALE_CAS_URL + 'gid').text.strip()
self.sno = tree.find(self.YALE_CAS_URL + 'user').text.strip()
return tree

Expand Down

0 comments on commit 5fce378

Please sign in to comment.