Is there anymore info on how to integrate login ap...
# talk-kratos
m
Is there anymore info on how to integrate login api with reactjs? if (loginFlowResponse) { let body: any = {}; for (const node of loginFlowResponse.data.ui.nodes as any[]) { if (node.attributes['name'] === 'password_identifier') { body['password_identifier'] = values.password; } else if (node.attributes['name'] === 'password') { body['password'] = values.password; } else { body[node.attributes['name']] = node.attributes['value']; } } console.log("bodybodybody", body); body = { ...body, password_identifier: values.email }; const param = { csrf_token: body.csrf_token, method: 'password', password: body.password, password_identifier: body.password_identifier, }; console.log("paramparamparam", body); const result = await axios .post(
<http://localhost:4433/self-service/login?flow=${loginFlowResponse.data.id}>
, param, { withCredentials: true, headers: { 'Content-Type': 'application/json', }, } ).then((res) => { console.log("fasdfasdfasdfasd", res) setLoading(false) }).catch((err) => { console.log("errerrerrerrerrerr=", err) }); console.log("resultresultresultresultresultresult", result); } this is my reactjs code api request