adit endpoints
This commit is contained in:
@@ -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({
|
||||||
email: email,
|
version: 1,
|
||||||
password: password
|
msg_id: 20001,
|
||||||
|
message_body: {
|
||||||
|
email: email,
|
||||||
|
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');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user