parent
17135a0cff
commit
b0c22ce357
6 changed files with 12 additions and 7 deletions
|
@ -1,3 +1,4 @@
|
|||
import { fetchWithError } from "@keycloak/keycloak-admin-client";
|
||||
import type AuthenticationFlowRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationFlowRepresentation";
|
||||
import RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation";
|
||||
import {
|
||||
|
@ -101,7 +102,7 @@ export default function AuthenticationSection() {
|
|||
]);
|
||||
|
||||
const loader = async () => {
|
||||
const flowsRequest = await fetch(
|
||||
const flowsRequest = await fetchWithError(
|
||||
`${addTrailingSlash(
|
||||
adminClient.baseUrl,
|
||||
)}admin/realms/${realmName}/ui-ext/authentication-management/flows`,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { fetchWithError } from "@keycloak/keycloak-admin-client";
|
||||
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
|
||||
import { Language } from "@patternfly/react-code-editor";
|
||||
import {
|
||||
|
@ -61,7 +62,7 @@ export default function ImportForm() {
|
|||
return JSON.parse(contents);
|
||||
}
|
||||
|
||||
const response = await fetch(
|
||||
const response = await fetchWithError(
|
||||
`${addTrailingSlash(
|
||||
adminClient.baseUrl,
|
||||
)}admin/realms/${realm}/client-description-converter`,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { fetchWithError } from "@keycloak/keycloak-admin-client";
|
||||
import {
|
||||
Form,
|
||||
FormGroup,
|
||||
|
@ -11,8 +12,8 @@ import {
|
|||
import { saveAs } from "file-saver";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { HelpItem, useHelp } from "ui-shared";
|
||||
|
||||
import { adminClient } from "../../admin-client";
|
||||
import { useRealm } from "../../context/realm-context/RealmContext";
|
||||
import { useServerInfo } from "../../context/server-info/ServerInfoProvider";
|
||||
|
@ -61,7 +62,7 @@ export const DownloadDialog = ({
|
|||
useFetch(
|
||||
async () => {
|
||||
if (selectedConfig?.mediaType === "application/zip") {
|
||||
const response = await fetch(
|
||||
const response = await fetchWithError(
|
||||
`${addTrailingSlash(
|
||||
adminClient.baseUrl,
|
||||
)}admin/realms/${realm}/clients/${id}/installation/providers/${selected}`,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { fetchWithError } from "@keycloak/keycloak-admin-client";
|
||||
import { adminClient } from "../../admin-client";
|
||||
import { getAuthorizationHeaders } from "../../utils/getAuthorizationHeaders";
|
||||
import { joinPath } from "../../utils/joinPath";
|
||||
|
@ -9,7 +10,7 @@ export async function fetchAdminUI<T>(
|
|||
const accessToken = await adminClient.getAccessToken();
|
||||
const baseUrl = adminClient.baseUrl;
|
||||
|
||||
const response = await fetch(
|
||||
const response = await fetchWithError(
|
||||
joinPath(baseUrl, "admin/realms", adminClient.realmName, endpoint) +
|
||||
(query ? "?" + new URLSearchParams(query) : ""),
|
||||
{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { fetchWithError } from "@keycloak/keycloak-admin-client";
|
||||
import type IdentityProviderRepresentation from "@keycloak/keycloak-admin-client/lib/defs/identityProviderRepresentation";
|
||||
import { FormGroup, Title } from "@patternfly/react-core";
|
||||
import { useFormContext } from "react-hook-form";
|
||||
|
@ -47,7 +48,7 @@ export const SamlConnectSettings = () => {
|
|||
formData.append("file", new Blob([xml]));
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
const response = await fetchWithError(
|
||||
`${addTrailingSlash(
|
||||
adminClient.baseUrl,
|
||||
)}admin/realms/${realm}/identity-provider/import-config`,
|
||||
|
|
|
@ -3,5 +3,5 @@ import { RequiredActionAlias } from "./defs/requiredActionProviderRepresentation
|
|||
|
||||
export const requiredAction = RequiredActionAlias;
|
||||
export default KeycloakAdminClient;
|
||||
export { NetworkError } from "./utils/fetchWithError.js";
|
||||
export { NetworkError, fetchWithError } from "./utils/fetchWithError.js";
|
||||
export type { NetworkErrorOptions } from "./utils/fetchWithError.js";
|
||||
|
|
Loading…
Reference in a new issue