Fix username property
This commit is contained in:
parent
a881b94396
commit
771a3e3260
|
@ -53,11 +53,14 @@ class OIDCAuthentication(_OIDCAuth):
|
|||
|
||||
@property
|
||||
def userinfo(self) -> dict:
|
||||
log.debug(flask_session.get('userinfo', {}))
|
||||
return flask_session.get('userinfo', {})
|
||||
|
||||
@property
|
||||
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
|
||||
def email(self) -> str:
|
||||
|
|
Loading…
Reference in New Issue