Compare commits

...

2 Commits

Author SHA1 Message Date
Andrea Mistrali c2bd5a1acc
Bump version to 0.9.24 2025-01-17 12:37:24 +01:00
Andrea Mistrali 771a3e3260
Fix username property 2025-01-17 12:37:02 +01:00
2 changed files with 5 additions and 2 deletions

View File

@ -53,11 +53,14 @@ class OIDCAuthentication(_OIDCAuth):
@property @property
def userinfo(self) -> dict: def userinfo(self) -> dict:
log.debug(flask_session.get('userinfo', {}))
return flask_session.get('userinfo', {}) return flask_session.get('userinfo', {})
@property @property
def username(self) -> str: def username(self) -> str:
return self.userinfo.get('preferred_username', 'unknown') # This need to be changed after upgrading headscale version
# when hs will use the preferred_username field as username
return self.email.split('@')[0]
@property @property
def email(self) -> str: def email(self) -> str:

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "hsman" name = "hsman"
version = "0.9.23" version = "0.9.24"
description = "Flask Admin webui for Headscale" description = "Flask Admin webui for Headscale"
authors = ["Andrea Mistrali <andrea@mistrali.pw>"] authors = ["Andrea Mistrali <andrea@mistrali.pw>"]
license = "BSD" license = "BSD"