aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-06-20 18:15:43 -0300
committerSebastian <sebasjm@gmail.com>2024-06-20 18:15:43 -0300
commit23031fc5d2255fd314eb8c80756393c18d84e02f (patch)
treefc40adefa41f2dec0656909d660c3a96f6f8fa06 /packages
parente1319ca80f9da544ecea95b4e43cb7b054569649 (diff)
downloadwallet-core-23031fc5d2255fd314eb8c80756393c18d84e02f.tar.xz
show login form on token error
Diffstat (limited to 'packages')
-rw-r--r--packages/bank-ui/src/pages/AccountPage/index.ts7
-rw-r--r--packages/bank-ui/src/pages/WireTransfer.tsx7
-rw-r--r--packages/bank-ui/src/pages/account/ShowAccountDetails.tsx7
-rw-r--r--packages/bank-ui/src/pages/admin/RemoveAccount.tsx7
4 files changed, 24 insertions, 4 deletions
diff --git a/packages/bank-ui/src/pages/AccountPage/index.ts b/packages/bank-ui/src/pages/AccountPage/index.ts
index 8a9471ef4..e96702652 100644
--- a/packages/bank-ui/src/pages/AccountPage/index.ts
+++ b/packages/bank-ui/src/pages/AccountPage/index.ts
@@ -26,6 +26,7 @@ import { LoginForm } from "../LoginForm.js";
import { useComponentState } from "./state.js";
import { InvalidIbanView, ReadyView } from "./views.js";
import { RouteDefinition } from "@gnu-taler/web-util/browser";
+import { Fragment } from "preact";
export interface Props {
account: string;
@@ -125,7 +126,11 @@ const viewMapping: utils.StateViewMap<State> = {
loading: Loading,
login: LoginForm,
"invalid-iban": InvalidIbanView,
- "loading-error": ErrorLoadingWithDebug,
+ "loading-error": (d) => {
+ return Fragment({
+ children: [ErrorLoadingWithDebug({ error: d.error }), LoginForm({})],
+ })!;
+ },
ready: ReadyView,
};
diff --git a/packages/bank-ui/src/pages/WireTransfer.tsx b/packages/bank-ui/src/pages/WireTransfer.tsx
index f45390938..817145702 100644
--- a/packages/bank-ui/src/pages/WireTransfer.tsx
+++ b/packages/bank-ui/src/pages/WireTransfer.tsx
@@ -62,7 +62,12 @@ export function WireTransfer({
return <Loading />;
}
if (result instanceof TalerError) {
- return <ErrorLoadingWithDebug error={result} />;
+ return (
+ <Fragment>
+ <ErrorLoadingWithDebug error={result} />
+ <LoginForm currentUser={account} />
+ </Fragment>
+ );
}
if (result.type === "fail") {
switch (result.case) {
diff --git a/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx b/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx
index 7db81115f..f602c67df 100644
--- a/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx
+++ b/packages/bank-ui/src/pages/account/ShowAccountDetails.tsx
@@ -91,7 +91,12 @@ export function ShowAccountDetails({
return <Loading />;
}
if (result instanceof TalerError) {
- return <ErrorLoadingWithDebug error={result} />;
+ return (
+ <Fragment>
+ <ErrorLoadingWithDebug error={result} />
+ <LoginForm currentUser={account} />
+ </Fragment>
+ );
}
if (result.type === "fail") {
switch (result.case) {
diff --git a/packages/bank-ui/src/pages/admin/RemoveAccount.tsx b/packages/bank-ui/src/pages/admin/RemoveAccount.tsx
index dbeebf719..74e39112d 100644
--- a/packages/bank-ui/src/pages/admin/RemoveAccount.tsx
+++ b/packages/bank-ui/src/pages/admin/RemoveAccount.tsx
@@ -74,7 +74,12 @@ export function RemoveAccount({
return <Loading />;
}
if (result instanceof TalerError) {
- return <ErrorLoadingWithDebug error={result} />;
+ return (
+ <Fragment>
+ <ErrorLoadingWithDebug error={result} />
+ <LoginForm currentUser={account} />
+ </Fragment>
+ );
}
if (result.type === "fail") {
switch (result.case) {