diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/token')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/token/DetailPage.tsx | 7 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx | 12 |
2 files changed, 10 insertions, 9 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/token/DetailPage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/token/DetailPage.tsx index f2b1db29b..c833b908c 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/token/DetailPage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/token/DetailPage.tsx @@ -77,9 +77,9 @@ export function DetailPage({ async function submitForm() { if (hasErrors) return; const oldToken = hasToken - ? (`secret-token:${form.old_token}` as AccessToken) + ? (form.old_token as AccessToken) : undefined; - const newToken = `secret-token:${form.new_token}` as AccessToken; + const newToken = form.new_token as AccessToken; onNewToken(oldToken, newToken); } @@ -133,8 +133,7 @@ export function DetailPage({ class="button" onClick={() => { if (hasToken) { - const oldToken = - `secret-token:${form.old_token}` as AccessToken; + const oldToken = form.old_token as AccessToken; onClearToken(oldToken); } else { onClearToken(undefined); diff --git a/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx index 13b5c45f1..f3c9a52ea 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx @@ -13,16 +13,16 @@ You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { AccessToken, HttpStatusCode, TalerErrorDetail } from "@gnu-taler/taler-util"; +import { HttpStatusCode, TalerErrorDetail } from "@gnu-taler/taler-util"; import { ErrorType, HttpError, useMerchantApiContext, useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; import { Loading } from "../../../components/exception/loading.js"; import { NotificationCard } from "../../../components/menu/index.js"; -import { useInstanceAPI, useInstanceDetails } from "../../../hooks/instance.js"; +import { useSessionContext } from "../../../context/session.js"; +import { useInstanceDetails } from "../../../hooks/instance.js"; import { Notification } from "../../../utils/types.js"; import { DetailPage } from "./DetailPage.js"; -import { useSessionContext } from "../../../context/session.js"; interface Props { onUnauthorized: () => VNode; @@ -43,7 +43,7 @@ export default function Token({ const { lib } = useMerchantApiContext(); const { logIn } = useSessionContext(); const [notif, setNotif] = useState<Notification | undefined>(undefined); - const { clearAccessToken } = useInstanceAPI(); + // const { clearAccessToken } = useInstanceAPI(); const result = useInstanceDetails() if (result.loading) return <Loading />; @@ -71,7 +71,9 @@ export default function Token({ hasToken={hasToken} onClearToken={async (currentToken): Promise<void> => { try { - await clearAccessToken(currentToken); + await lib.management.updateCurrentInstanceAuthentication(currentToken, { + method: "external", + }) onChange(); } catch (error) { if (error instanceof Error) { |