Catch 403 when only query-clients is allowed (#2182)

This commit is contained in:
Erik Jan de Wit 2022-03-10 11:46:42 +01:00 committed by GitHub
parent f7e0596301
commit 47a8c25c99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,8 +24,13 @@ export const InitialAccessTokenList = () => {
const [token, setToken] = useState<ClientInitialAccessPresentation>();
const loader = async () =>
await adminClient.realms.getClientsInitialAccess({ realm });
const loader = async () => {
try {
return await adminClient.realms.getClientsInitialAccess({ realm });
} catch (error) {
return [];
}
};
const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
titleKey: "clients:tokenDeleteConfirmTitle",