mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-29 02:10:59 -05:00
fix: use config for client in login
This commit is contained in:
parent
fc046936aa
commit
56925b3ea2
1 changed files with 3 additions and 3 deletions
|
@ -9,7 +9,7 @@ import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
||||||
import { Form } from "./Form";
|
import { Form } from "./Form";
|
||||||
|
|
||||||
export function FormLogin() {
|
export function FormLogin() {
|
||||||
const auth = useApplicationState().auth;
|
const state = useApplicationState();
|
||||||
const { openScreen } = useIntermediate();
|
const { openScreen } = useIntermediate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -37,7 +37,7 @@ export function FormLogin() {
|
||||||
|
|
||||||
// ! FIXME: temporary login flow code
|
// ! FIXME: temporary login flow code
|
||||||
// This should be replaced in the future.
|
// This should be replaced in the future.
|
||||||
const client = new Client();
|
const client = state.config.createClient();
|
||||||
await client.fetchConfiguration();
|
await client.fetchConfiguration();
|
||||||
const session = (await client.req(
|
const session = (await client.req(
|
||||||
"POST",
|
"POST",
|
||||||
|
@ -51,7 +51,7 @@ export function FormLogin() {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function login() {
|
async function login() {
|
||||||
auth.setSession(session);
|
state.auth.setSession(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { onboarding } = await client.req(
|
const { onboarding } = await client.req(
|
||||||
|
|
Loading…
Reference in a new issue