diff options
author | Sebastian <sebasjm@gmail.com> | 2023-09-11 15:07:55 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-09-11 15:08:08 -0300 |
commit | 8c20f4b27946679267bb44255721a9f14ae1077a (patch) | |
tree | 389d7dac804af0e17652240094947e710f503dd3 /packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx | |
parent | e2422b68ebb2a29fb2e4d86f8a8cf9ec2a33e099 (diff) | |
download | wallet-core-8c20f4b27946679267bb44255721a9f14ae1077a.tar.gz wallet-core-8c20f4b27946679267bb44255721a9f14ae1077a.tar.bz2 wallet-core-8c20f4b27946679267bb44255721a9f14ae1077a.zip |
new login token
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx index 4a8162611..6c5e7a514 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/update/index.tsx @@ -13,18 +13,19 @@ 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 { HttpStatusCode } from "@gnu-taler/taler-util"; import { ErrorType, HttpError, HttpResponse, useTranslationContext, } from "@gnu-taler/web-util/browser"; -import { Fragment, h, VNode } from "preact"; +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 { useInstanceContext } from "../../../context/instance.js"; -import { MerchantBackend } from "../../../declaration.js"; +import { AccessToken, MerchantBackend } from "../../../declaration.js"; import { useInstanceAPI, useInstanceDetails, @@ -33,7 +34,6 @@ import { } from "../../../hooks/instance.js"; import { Notification } from "../../../utils/types.js"; import { UpdatePage } from "./UpdatePage.js"; -import { HttpStatusCode } from "@gnu-taler/taler-util"; export interface Props { onBack: () => void; @@ -73,10 +73,9 @@ function CommonUpdate( MerchantBackend.ErrorDetail >, updateInstance: any, - clearToken: any, - setNewToken: any, + clearToken: () => Promise<void>, + setNewToken: (t: AccessToken) => Promise<void>, ): VNode { - const { changeToken } = useInstanceContext(); const [notif, setNotif] = useState<Notification | undefined>(undefined); const { i18n } = useTranslationContext(); @@ -119,11 +118,8 @@ function CommonUpdate( d: MerchantBackend.Instances.InstanceAuthConfigurationMessage, ): Promise<void> => { const apiCall = - d.method === "external" ? clearToken() : setNewToken(d.token!); - return apiCall - .then(() => changeToken(d.token)) - .then(onConfirm) - .catch(onUpdateError); + d.method === "external" ? clearToken() : setNewToken(d.token! as AccessToken); + return apiCall.then(onConfirm).catch(onUpdateError); }} /> </Fragment> |