diff --git a/src/Components/Auth/Login.tsx b/src/Components/Auth/Login.tsx index 01596b85d09..1f19550b50d 100644 --- a/src/Components/Auth/Login.tsx +++ b/src/Components/Auth/Login.tsx @@ -95,9 +95,10 @@ export const Login = (props: { forgot?: boolean }) => { // replaces button with spinner setLoading(true); - const { res, data } = await request(routes.login, { - pathParams: { ...valid }, + const { res, data, error } = await request(routes.login, { + body: { ...valid }, }); + console.log(res, data, error); if (res && res.status === 429) { setCaptcha(true); // captcha displayed set back to login button @@ -105,7 +106,6 @@ export const Login = (props: { forgot?: boolean }) => { } else if (res && res.status === 200 && data) { localStorage.setItem(LocalStorageKeys.accessToken, data.access); localStorage.setItem(LocalStorageKeys.refreshToken, data.refresh); - if ( window.location.pathname === "/" || window.location.pathname === "/login" @@ -149,7 +149,7 @@ export const Login = (props: { forgot?: boolean }) => { if (valid) { setLoading(true); const { res, error } = await request(routes.forgotPassword, { - pathParams: { ...valid }, + body: { ...valid }, }); setLoading(false); if (res && res.statusText === "OK") { diff --git a/src/Components/Auth/ResetPassword.tsx b/src/Components/Auth/ResetPassword.tsx index 8a29decd4f1..2f02737f6de 100644 --- a/src/Components/Auth/ResetPassword.tsx +++ b/src/Components/Auth/ResetPassword.tsx @@ -70,7 +70,7 @@ export const ResetPassword = (props: any) => { if (valid) { valid.token = props.token; const { res, error } = await request(routes.resetPassword, { - pathParams: { ...valid }, + body: { ...valid }, }); if (res && res.statusText === "OK") { localStorage.removeItem(LocalStorageKeys.accessToken); @@ -87,7 +87,7 @@ export const ResetPassword = (props: any) => { useEffect(() => { const checkResetToken = async () => { const { res } = await request(routes.checkResetToken, { - pathParams: { token: props.token }, + body: { token: props.token }, }); if (!res || res.statusText !== "OK") { navigate("/invalid-reset");