adit endpoints

This commit is contained in:
smanylov
2025-12-11 20:38:06 +07:00
parent 67c6d07e4d
commit b63828befb
2 changed files with 9 additions and 5 deletions
+6 -2
View File
@@ -75,11 +75,15 @@ export async function authorization(
try { try {
const { email, password } = validatedFields.data; 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', method: 'POST',
body: JSON.stringify({ body: JSON.stringify({
version: 1,
msg_id: 20001,
message_body: {
email: email, email: email,
password: password password: password
}
}), }),
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
@@ -88,7 +92,7 @@ export async function authorization(
}); });
if (response.ok) { if (response.ok) {
let parsed = await response.json(); let parsed = await response.json();
await createSession(parsed.token, parsed.email); await createSession(parsed.message_body.token, email);
} else { } else {
throw ('request-ended-with-an-error'); throw ('request-ended-with-an-error');
} }
+1 -1
View File
@@ -55,7 +55,7 @@ export const loginFormSchema = z
.trim(), .trim(),
}) })
export const localDevelopmentUrl = 'http://localhost:80'; export const localDevelopmentUrl = 'http://localhost';
export const testUserData = { export const testUserData = {
fullName: 'test', fullName: 'test',