This commit is contained in:
smanylov
2025-12-04 12:49:00 +07:00
parent fdbd67914f
commit 3b39c2601d
2 changed files with 5 additions and 9 deletions
+3 -7
View File
@@ -6,7 +6,7 @@ import { redirect } from 'next/navigation';
const API_BASE_URL = process.env.NODE_ENV === 'development'
? localDevelopmentUrl
: 'http://no_copy_app:8080';
: 'http://app:8080';
export async function logout() {
const token = await getSessionData('token');
@@ -109,22 +109,18 @@ export async function registration(
}
});
console.log('Status:', response.status);
console.log('Status text:', response.statusText);
if (response.ok) {
let parsed = await response.json();
await createSession(parsed.token, email);
} else {
throw new Error(`
-error-. status: ${response.status}
-error-1. status: ${response.status}
`);
}
} catch (error) {
if (error) {
const errors: Record<string, string> = {}
errors['server'] = `Fetch error-> ${error}`
errors['server'] = `-error-2 -> ${error}`
return errors;
}
throw error;