diff --git a/frontend/src/app/components/auth/login/login.component.html b/frontend/src/app/components/auth/login/login.component.html
index 15f4682..3b41349 100644
--- a/frontend/src/app/components/auth/login/login.component.html
+++ b/frontend/src/app/components/auth/login/login.component.html
@@ -43,7 +43,7 @@
pattern="[^<>]*"
minlength="6"
[class.error-border]="
- password.invalid && password.touched && authData.password.length > 0
+ password.invalid && password.touched && authData.password.length < 6
"
required
/>
@@ -51,13 +51,15 @@
@if (!password.valid && password.touched && authData.password.length <
1) {
Please enter your password
- } @else { @if (authData.password.length < 6 && password.touched) {
+ } @else { @if (authData.password && authData.password.length < 6 &&
+ password.touched) {
Password is too short, min 6 characters
} }
0) ||
!password.valid
"
diff --git a/frontend/src/app/components/auth/login/login.component.scss b/frontend/src/app/components/auth/login/login.component.scss
index ceb7a7f..9dd4baf 100644
--- a/frontend/src/app/components/auth/login/login.component.scss
+++ b/frontend/src/app/components/auth/login/login.component.scss
@@ -86,6 +86,10 @@ section {
}
}
.error-border {
- border: 1px solid red;
+ border: 1px solid $red;
+ color: $red;
+ &::placeholder {
+ color: $red;
+ }
}
}
diff --git a/frontend/src/app/components/auth/login/login.component.ts b/frontend/src/app/components/auth/login/login.component.ts
index 772b562..1de7700 100644
--- a/frontend/src/app/components/auth/login/login.component.ts
+++ b/frontend/src/app/components/auth/login/login.component.ts
@@ -14,6 +14,7 @@ export class LoginComponent {
authData = {
mail: '',
password: '',
+ send: false,
};
constructor() {}
@@ -26,8 +27,7 @@ export class LoginComponent {
onSubmit(ngForm: NgForm) {
if (ngForm.submitted && ngForm.form.valid) {
console.log(this.authData);
- this.authData.mail = '';
- this.authData.password = '';
+ ngForm.resetForm();
}
}
}
diff --git a/frontend/src/app/components/auth/register/register.component.html b/frontend/src/app/components/auth/register/register.component.html
index d923bb8..2e4fe85 100644
--- a/frontend/src/app/components/auth/register/register.component.html
+++ b/frontend/src/app/components/auth/register/register.component.html
@@ -34,14 +34,20 @@
[(ngModel)]="authData.password"
pattern="[^<>]*"
minlength="6"
- [class.error-border]="password.invalid && password.touched"
+ [class.error-border]="
+ password.invalid && password.touched && authData.password.length < 6
+ "
[disabled]="!authData.params"
required
/>
- @if (authData.password.length < 6 && password.touched) {
+ @if (!password.valid && password.touched && authData.password.length <
+ 1) {
+
Please enter a password
+ } @else { @if (authData.password && authData.password.length < 6 &&
+ password.touched) {
Password is too short, min 6 characters
- }
+ } }
0) ||
- !authData.params
+ !authData.params ||
+ authData.password !== authData.passwordConfirm ||
+ !authData.password ||
+ !authData.passwordConfirm
"
>
diff --git a/frontend/src/app/components/auth/register/register.component.scss b/frontend/src/app/components/auth/register/register.component.scss
index 9aef02e..a948147 100644
--- a/frontend/src/app/components/auth/register/register.component.scss
+++ b/frontend/src/app/components/auth/register/register.component.scss
@@ -86,6 +86,10 @@ section {
}
}
.error-border {
- border: 1px solid red;
+ border: 1px solid $red;
+ color: $red;
+ &::placeholder {
+ color: $red;
+ }
}
}
diff --git a/frontend/src/app/components/auth/register/register.component.ts b/frontend/src/app/components/auth/register/register.component.ts
index 4cd7e14..f7faadf 100644
--- a/frontend/src/app/components/auth/register/register.component.ts
+++ b/frontend/src/app/components/auth/register/register.component.ts
@@ -36,8 +36,10 @@ export class RegisterComponent {
onSubmit(ngForm: NgForm) {
if (ngForm.submitted && ngForm.form.valid) {
- console.log(this.authData.mail);
- this.authData.mail = '';
+ let mail = this.authData.mail;
+ console.log(this.authData);
+ ngForm.form.reset();
+ ngForm.form.patchValue({ mail: mail });
}
}
}
diff --git a/frontend/src/assets/style/colors.scss b/frontend/src/assets/style/colors.scss
index 9ac1bed..5a0bc7f 100644
--- a/frontend/src/assets/style/colors.scss
+++ b/frontend/src/assets/style/colors.scss
@@ -3,4 +3,4 @@ $white: #fff;
$black: #000;
$gray: #ababab;
$blue: #2e3edf;
-$red: #ff0000;
+$red: #ff002e;