diff --git a/client/src/api/contactsApi.tsx b/client/src/api/contactsApi.tsx index 8cebba5..91cfdf7 100644 --- a/client/src/api/contactsApi.tsx +++ b/client/src/api/contactsApi.tsx @@ -1,17 +1,6 @@ import { ChatMessagesProps, ContactsProps } from '@/types/types.ts'; import { axiosClient } from '@/utils/axiosClient.ts'; -export async function getContactsList(): Promise { - try { - const response = await axiosClient.get(`/api/chat/contacts`); - console.log('Get contacts list response: ', response.data); - return response.data; - } catch (e) { - console.error('Failed to fetch /api/chat/contacts: ', e); - throw e; - } -} - export async function sendContact(contact: string) { try { const response = await axiosClient.post(`/api/chat/contact/${contact}`); @@ -43,15 +32,3 @@ export async function getMessages( throw e; } } - -export async function deleteContact(usernamecontact: string) { - try { - const response = await axiosClient.delete( - `/api/chat/contacts/${usernamecontact}`, - ); - console.log(response.data); - return response.data; - } catch (e) { - console.error('Failed to delete contact: ', e); - } -} diff --git a/client/src/pages/Login.tsx b/client/src/pages/Login.tsx index d4adf6a..3ad8e66 100644 --- a/client/src/pages/Login.tsx +++ b/client/src/pages/Login.tsx @@ -31,7 +31,6 @@ export default function Login() { setUser({ username: res.data.username, id: res.data.user_id }); setAuthorized(true); setIsLoading(false); - console.log('redirecting'); navigate('/chat'); }) .catch((err) => { diff --git a/server/server.js b/server/server.js index 67fa32e..ea06f9e 100644 --- a/server/server.js +++ b/server/server.js @@ -136,8 +136,6 @@ app.post("/api/auth/signup", async (req, res) => { const token = generateJwtToken(username, user_id); res.cookie("token", token, { maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days - httpOnly: true, - // secure: true, }); return res.status(200).json({