From 56925b3ea2d34c1ee6fd3f1710b59da86c75d663 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 8 Jan 2022 16:51:34 +0000 Subject: [PATCH] fix: use config for client in login --- src/pages/login/forms/FormLogin.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/login/forms/FormLogin.tsx b/src/pages/login/forms/FormLogin.tsx index ee584a4e..2b5cfc56 100644 --- a/src/pages/login/forms/FormLogin.tsx +++ b/src/pages/login/forms/FormLogin.tsx @@ -9,7 +9,7 @@ import { useIntermediate } from "../../../context/intermediate/Intermediate"; import { Form } from "./Form"; export function FormLogin() { - const auth = useApplicationState().auth; + const state = useApplicationState(); const { openScreen } = useIntermediate(); return ( @@ -37,7 +37,7 @@ export function FormLogin() { // ! FIXME: temporary login flow code // This should be replaced in the future. - const client = new Client(); + const client = state.config.createClient(); await client.fetchConfiguration(); const session = (await client.req( "POST", @@ -51,7 +51,7 @@ export function FormLogin() { }; async function login() { - auth.setSession(session); + state.auth.setSession(session); } const { onboarding } = await client.req(