From b63828befba0c35d827b50e808588151152a0eb7 Mon Sep 17 00:00:00 2001 From: smanylov Date: Thu, 11 Dec 2025 20:38:06 +0700 Subject: [PATCH] adit endpoints --- src/app/actions/auth.ts | 12 ++++++++---- src/app/actions/definitions.ts | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/actions/auth.ts b/src/app/actions/auth.ts index 36b3901..4ad5d48 100644 --- a/src/app/actions/auth.ts +++ b/src/app/actions/auth.ts @@ -75,11 +75,15 @@ export async function authorization( try { const { email, password } = validatedFields.data; - const response = await fetch(`${API_BASE_URL}/v1/api/auth/login`, { + const response = await fetch(`${API_BASE_URL}/api/v1/data`, { method: 'POST', body: JSON.stringify({ - email: email, - password: password + version: 1, + msg_id: 20001, + message_body: { + email: email, + password: password + } }), headers: { "Content-Type": "application/json", @@ -88,7 +92,7 @@ export async function authorization( }); if (response.ok) { let parsed = await response.json(); - await createSession(parsed.token, parsed.email); + await createSession(parsed.message_body.token, email); } else { throw ('request-ended-with-an-error'); } diff --git a/src/app/actions/definitions.ts b/src/app/actions/definitions.ts index 01e09a7..d5f03a2 100644 --- a/src/app/actions/definitions.ts +++ b/src/app/actions/definitions.ts @@ -55,7 +55,7 @@ export const loginFormSchema = z .trim(), }) -export const localDevelopmentUrl = 'http://localhost:80'; +export const localDevelopmentUrl = 'http://localhost'; export const testUserData = { fullName: 'test',