Skip to content
Snippets Groups Projects
Commit 78a195a5 authored by Laczkó Csongor Loránd's avatar Laczkó Csongor Loránd
Browse files

feat: Enhance login and register pages

- Add title to login and register pages
- Change registration error message display from alert to text
parent c219826b
No related branches found
No related tags found
No related merge requests found
<template>
<div class="login-container">
<h1 class="title">Bejelentkezés</h1>
<div v-if="registrationSuccess" class="alert alert-success">
Regisztráció sikeres! Most már bejelentkezhetsz.
</div>
......@@ -95,4 +96,8 @@ p {
.alert-error {
@apply bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4;
}
.title {
@apply text-4xl font-bold mb-8 text-center p-4;
}
</style>
\ No newline at end of file
<template>
<div class="login-container">
<h1 class="title">Regisztráció</h1>
<div v-if="error" class="alert alert-error">
{{ error }}
</div>
<form @submit.prevent="register">
<div class="input-group">
<label for="username">Felhasználónév</label>
......@@ -23,6 +27,7 @@ export default {
return {
username: '',
password: '',
error: '',
};
},
methods: {
......@@ -44,9 +49,9 @@ export default {
// Display error message
if (error.response && error.response.data) {
alert('Registration failed: ' + error.response.data);
this.error = 'Registration failed: ' + error.response.data;
} else {
alert('Registration failed: ' + error.message);
this.error = 'Registration failed: ' + error.message;
}
}
},
......@@ -74,4 +79,12 @@ input {
button {
@apply px-4 py-2 mt-4 text-sm font-medium text-white bg-blue-500 rounded hover:bg-blue-700 focus:outline-none;
}
.title {
@apply text-4xl font-bold mb-8 text-center p-4;
}
.alert-error {
@apply bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4;
}
</style>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment