Fix username property
This commit is contained in:
parent
a881b94396
commit
771a3e3260
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue