diff options
Diffstat (limited to 'packages/bank-ui/src/pages/LoginForm.tsx')
-rw-r--r-- | packages/bank-ui/src/pages/LoginForm.tsx | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/packages/bank-ui/src/pages/LoginForm.tsx b/packages/bank-ui/src/pages/LoginForm.tsx index 7eed0cd9e..2f967895c 100644 --- a/packages/bank-ui/src/pages/LoginForm.tsx +++ b/packages/bank-ui/src/pages/LoginForm.tsx @@ -52,7 +52,9 @@ export function LoginForm({ ); const [password, setPassword] = useState<string | undefined>(); const { i18n } = useTranslationContext(); - const { lib: { auth: authenticator } } = useBankCoreApiContext(); + const { + lib: { auth: authenticator }, + } = useBankCoreApiContext(); const [notification, withErrorHandler] = useLocalNotificationHandler(); const { config } = useBankCoreApiContext(); @@ -78,24 +80,24 @@ export function LoginForm({ !username || !password ? undefined : withErrorHandler( - async () => - authenticator(username).createAccessTokenBasic(username, password, { - scope: "readwrite", - duration: { d_us: "forever" }, - refreshable: true, - }), - (result) => { - session.logIn({ username, token: result.body.access_token }); - }, - (fail) => { - switch (fail.case) { - case HttpStatusCode.Unauthorized: - return i18n.str`Wrong credentials for "${username}"`; - case HttpStatusCode.NotFound: - return i18n.str`Account not found`; - } - }, - ); + async () => + authenticator(username).createAccessTokenBasic(username, password, { + scope: "readwrite", + duration: { d_us: "forever" }, + refreshable: true, + }), + (result) => { + session.logIn({ username, token: result.body.access_token }); + }, + (fail) => { + switch (fail.case) { + case HttpStatusCode.Unauthorized: + return i18n.str`Wrong credentials for "${username}"`; + case HttpStatusCode.NotFound: + return i18n.str`Account not found`; + } + }, + ); return ( <div class="flex min-h-full flex-col justify-center "> |