This commit is contained in:
2026-04-18 13:32:57 +03:00
parent 9b12895199
commit 7cc1ff9555
7 changed files with 141 additions and 19 deletions

View File

@@ -16,7 +16,7 @@
<div class="bg-white rounded-2xl shadow-xl p-8">
<form @submit.prevent="handleLogin" class="space-y-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Username</label>
<label class="block text-sm font-medium text-gray-700 mb-2">Username or Email</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg class="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -28,7 +28,7 @@
type="text"
required
class="input-field pl-10"
placeholder="Enter your username"
placeholder="Enter your username or email"
/>
</div>
</div>
@@ -120,7 +120,13 @@ async function handleLogin() {
if (res.ok) {
router.push('/dashboard')
} else {
error.value = 'Invalid username or password'
// Пытаемся получить текст ошибки от сервера
const text = await res.text()
if (text && text.trim()) {
error.value = text
} else {
error.value = 'Invalid username or password'
}
}
} catch (e) {
error.value = 'Network error. Please try again.'