web/user: fix source connections not being filtered (#4778)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
9c82024fd5
commit
b7e4ad7234
|
@ -206,5 +206,6 @@ class UserSourceConnectionViewSet(
|
|||
queryset = UserSourceConnection.objects.all()
|
||||
serializer_class = UserSourceConnectionSerializer
|
||||
permission_classes = [OwnerSuperuserPermissions]
|
||||
filterset_fields = ["user"]
|
||||
filter_backends = [OwnerFilter, DjangoFilterBackend, OrderingFilter, SearchFilter]
|
||||
ordering = ["pk"]
|
||||
|
|
|
@ -17568,6 +17568,10 @@ paths:
|
|||
description: A search term.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: user
|
||||
schema:
|
||||
type: integer
|
||||
tags:
|
||||
- sources
|
||||
security:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { renderSourceIcon } from "@goauthentik/admin/sources/SourceViewPage";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { EVENT_REFRESH } from "@goauthentik/common/constants";
|
||||
import { me } from "@goauthentik/common/users";
|
||||
import { AKElement } from "@goauthentik/elements/Base";
|
||||
import "@goauthentik/elements/EmptyState";
|
||||
import "@goauthentik/user/user-settings/sources/SourceSettingsOAuth";
|
||||
|
@ -58,10 +59,11 @@ export class UserSourceSettingsPage extends AKElement {
|
|||
});
|
||||
}
|
||||
|
||||
firstUpdated(): void {
|
||||
async firstUpdated(): Promise<void> {
|
||||
const user = await me();
|
||||
this.sourceSettings = new SourcesApi(DEFAULT_CONFIG).sourcesAllUserSettingsList();
|
||||
new SourcesApi(DEFAULT_CONFIG).sourcesUserConnectionsAllList().then((connections) => {
|
||||
this.connections = connections;
|
||||
this.connections = await new SourcesApi(DEFAULT_CONFIG).sourcesUserConnectionsAllList({
|
||||
user: user.user.pk,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue