adit endpoints
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user