[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] 03/05: feat #7034
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] 03/05: feat #7034 |
Date: |
Tue, 07 Dec 2021 15:58:32 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository merchant-backoffice.
commit 955b03a413d8c6fd0e8749b7ffe33a2e1d28a90b
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Dec 6 11:01:42 2021 -0300
feat #7034
---
.../src/components/exception/login.tsx | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/packages/merchant-backoffice/src/components/exception/login.tsx
b/packages/merchant-backoffice/src/components/exception/login.tsx
index fbe71c8..498d994 100644
--- a/packages/merchant-backoffice/src/components/exception/login.tsx
+++ b/packages/merchant-backoffice/src/components/exception/login.tsx
@@ -38,6 +38,10 @@ function getTokenValuePart(t?: string): string | undefined {
return match[1];
}
+function normalizeToken(r: string | undefined): string | undefined {
+ return r ? `secret-token:${encodeURIComponent(r)}` : undefined;
+}
+
export function LoginModal({ onConfirm, withMessage }: Props): VNode {
const { url: backendUrl, token: baseToken } = useBackendContext();
const { admin, token: instanceToken } = useInstanceContext();
@@ -79,10 +83,7 @@ export function LoginModal({ onConfirm, withMessage }:
Props): VNode {
value={url}
onKeyPress={(e) =>
e.keyCode === 13
- ? onConfirm(
- url,
- token ? `secret-token:${token}` : undefined
- )
+ ? onConfirm(url, normalizeToken(token))
: null
}
onInput={(e): void => setURL(e?.currentTarget.value)}
@@ -107,10 +108,7 @@ export function LoginModal({ onConfirm, withMessage }:
Props): VNode {
name="token"
onKeyPress={(e) =>
e.keyCode === 13
- ? onConfirm(
- url,
- token ? `secret-token:${token}` : undefined
- )
+ ? onConfirm(url, normalizeToken(token))
: null
}
value={token}
@@ -132,7 +130,7 @@ export function LoginModal({ onConfirm, withMessage }:
Props): VNode {
<button
class="button is-info"
onClick={(): void => {
- onConfirm(url, token ? `secret-token:${token}` : undefined);
+ onConfirm(url, normalizeToken(token));
}}
>
<Translate>Confirm</Translate>
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.