[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] branch master updated: login and registratio
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] branch master updated: login and registration forms |
Date: |
Thu, 08 Sep 2022 17:12:42 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository merchant-backoffice.
The following commit(s) were added to refs/heads/master by this push:
new d236cd9 login and registration forms
d236cd9 is described below
commit d236cd90cfb8df3c5ab846dc400821b6b414c8a1
Author: MS <ms@taler.net>
AuthorDate: Thu Sep 8 17:10:14 2022 +0200
login and registration forms
clean credentials state after the submission.
At this point, the cleanup happens regardless
of the outcome; in future versions, the credentials
should be kept upon failures.
---
packages/bank/src/pages/home/index.tsx | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/packages/bank/src/pages/home/index.tsx
b/packages/bank/src/pages/home/index.tsx
index 110adf2..51cceb2 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -11,10 +11,9 @@ import talerLogo from "../../assets/logo-white.svg";
import { LangSelectorLikePy as LangSelector} from
"../../components/menu/LangSelector";
// Uncomment to allow test runs:
-
-/*const __LIBEUFIN_UI_ALLOW_REGISTRATIONS__ = 1;
-const __LIBEUFIN_UI_IS_DEMO__ = 0;
-const __LIBEUFIN_UI_BANK_NAME__ = 0;*/
+// const __LIBEUFIN_UI_ALLOW_REGISTRATIONS__ = 1;
+// const __LIBEUFIN_UI_IS_DEMO__ = 0;
+// const __LIBEUFIN_UI_BANK_NAME__ = 0;
/**
* FIXME:
@@ -1232,6 +1231,7 @@ function LoginForm(Props: any): VNode {
<div class="pure-form">
<input
type="text"
+ value={submitData && submitData.username}
placeholder="username"
required
onInput={(e): void => {
@@ -1241,6 +1241,7 @@ function LoginForm(Props: any): VNode {
}))}} />
<input
type="password"
+ value={submitData && submitData.password}
placeholder="password"
required
onInput={(e): void => {
@@ -1256,10 +1257,13 @@ function LoginForm(Props: any): VNode {
if (typeof submitData === "undefined") return;
if (submitData.password.length > 0 && submitData.username.length > 0)
loginCall(
- submitData,
+ // Deep copy, to avoid the cleanup
+ // below make data disappear.
+ {...submitData},
backendStateSetter,
pageStateSetter
);
+ submitDataSetter(undefined);
}}>{i18n`Login`}</button>
</div>
</form>);
@@ -1290,6 +1294,7 @@ function RegistrationForm(Props: any): VNode {
<input
type="text"
placeholder="username"
+ value={submitData && submitData.username}
required
autofocus
onInput={(e): void => {
@@ -1300,6 +1305,7 @@ function RegistrationForm(Props: any): VNode {
<input
type="password"
placeholder="password"
+ value={submitData && submitData.password}
required
autofocus
onInput={(e): void => {
@@ -1320,10 +1326,11 @@ function RegistrationForm(Props: any): VNode {
submitData.username.length === 0) return;
console.log("submitting the registration..");
registrationCall(
- submitData,
+ {...submitData},
Props.backendStateSetter, // will store BE URL, if OK.
pageStateSetter
- );}}>{i18n`Register`}</button>
+ );
+ submitDataSetter(undefined)}}>{i18n`Register`}</button>
</form>
</div>
</article>
@@ -1450,9 +1457,7 @@ function Account(Props: any): VNode {
* login would cache a 404 error to X's profile, resulting
* in the legitimate request after the registration to still
* be flagged as 404. Clearing the cache should prevent
- * this and likely not pose additional problems (given that
- * the user couldn't have been logged before).
- */
+ * this. */
(cache as any).clear();
return <p>Profile not found...</p>;
}
@@ -1742,11 +1747,6 @@ export function BankHome(): VNode {
</PageContext.Provider>
);
}
- /**
- * Credentials were correct, now render the bank account page,
- * with balance, transactions history, and a Taler withdrawal
- * button.
- */
if (pageState.isLoggedIn) {
if (typeof backendState === "undefined") {
pageStateSetter((prevState) => ({
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant-backoffice] branch master updated: login and registration forms,
gnunet <=