From de3511963c57174af45ca6db58cb7d96f558acf8 Mon Sep 17 00:00:00 2001 From: Trial Date: Sun, 30 Mar 2025 01:14:09 +0300 Subject: [PATCH] removed joi validation --- src/Components/TabPanels/Account/TeamPanel.jsx | 2 +- src/Features/Auth/authSlice.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Components/TabPanels/Account/TeamPanel.jsx b/src/Components/TabPanels/Account/TeamPanel.jsx index 950f0ea69..93fcb6d23 100644 --- a/src/Components/TabPanels/Account/TeamPanel.jsx +++ b/src/Components/TabPanels/Account/TeamPanel.jsx @@ -153,7 +153,7 @@ const TeamPanel = () => { try { await networkService.sendInvitationToken({ - email: toInvite.email, + email: toInvite.email.toLowerCase(), role: toInvite.role, }); closeInviteModal(); diff --git a/src/Features/Auth/authSlice.js b/src/Features/Auth/authSlice.js index 2fde49202..773ab3be5 100644 --- a/src/Features/Auth/authSlice.js +++ b/src/Features/Auth/authSlice.js @@ -12,7 +12,8 @@ const initialState = { export const register = createAsyncThunk("auth/register", async (form, thunkApi) => { try { - const res = await networkService.registerUser(form); + const newForm = {...form, email: form.email.toLowerCase()} + const res = await networkService.registerUser(newForm); return res.data; } catch (error) { if (error.response.data) { @@ -28,7 +29,8 @@ export const register = createAsyncThunk("auth/register", async (form, thunkApi) export const login = createAsyncThunk("auth/login", async (form, thunkApi) => { try { - const res = await networkService.loginUser(form); + const newForm = {...form, email: form.email.toLowerCase()} + const res = await networkService.loginUser(newForm); return res.data; } catch (error) { if (error.response && error.response.data) { @@ -98,7 +100,8 @@ export const forgotPassword = createAsyncThunk( "auth/forgotPassword", async (form, thunkApi) => { try { - const res = await networkService.forgotPassword(form); + const newForm = {...form, email: form.toLowerCase()}; + const res = await networkService.forgotPassword(newForm); return res.data; } catch (error) { if (error.response.data) {