From 3b39c2601de8cd7435a9eb69c007e8696f6f32ad Mon Sep 17 00:00:00 2001 From: smanylov Date: Thu, 4 Dec 2025 12:49:00 +0700 Subject: [PATCH] fix link --- src/app/actions/auth.ts | 10 +++------- src/app/lib/session.ts | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/app/actions/auth.ts b/src/app/actions/auth.ts index f404cfd..b69f6b2 100644 --- a/src/app/actions/auth.ts +++ b/src/app/actions/auth.ts @@ -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 = {} - errors['server'] = `Fetch error-> ${error}` + errors['server'] = `-error-2 -> ${error}` return errors; } throw error; diff --git a/src/app/lib/session.ts b/src/app/lib/session.ts index c5d510f..3b21674 100644 --- a/src/app/lib/session.ts +++ b/src/app/lib/session.ts @@ -40,7 +40,7 @@ export async function createSession(token: string, email: string) { expires: expiresAt, sameSite: 'lax', path: '/', - }) + }); } export async function getSessionData(type: 'token' | 'email'): Promise { @@ -63,5 +63,5 @@ export async function getSessionData(type: 'token' | 'email'): Promise