core: fix user_obj being empty on token API

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-30 12:51:14 +02:00
parent adc18b2991
commit a016f99450
3 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,7 @@ from authentik.managed.api import ManagedSerializer
class TokenSerializer(ManagedSerializer, ModelSerializer):
"""Token Serializer"""
user_obj = UserSerializer(required=False)
user_obj = UserSerializer(required=False, source="user")
def validate(self, attrs: dict[Any, str]) -> dict[Any, str]:
"""Ensure only API or App password tokens are created."""

View File

@ -103,7 +103,7 @@ export class TokenListPage extends TablePage<Token> {
row(item: Token): TemplateResult[] {
return [
html`${item.identifier}`,
html`${item.userObj?.username}`,
html`<a href="#/identity/users/${item.userObj?.pk}">${item.userObj?.username}</a>`,
html`${item.expiring ? t`Yes` : t`No`}`,
html`${item.expiring ? item.expires?.toLocaleString() : "-"}`,
html`${IntentToLabel(item.intent || IntentEnum.Api)}`,

View File

@ -101,6 +101,7 @@ slug: "2021.8"
## Fixed in 2021.8.4
- api: add basic rate limiting for sentry proxy endpoint
- core: fix user_obj being empty on token API
- outpost/embedded: only send requests for non-akprox paths when we're doing proxy mode
- outpost/ldap: delay user information removal upon closing of connection
- policies/password: fix PasswordStage not being usable with prompt stages