@@ -47,6 +53,11 @@
[(ngModel)]="authData.passwordConfirm"
pattern="[^<>]*"
minlength="6"
+ [class.error-border]="
+ authData.password !== authData.passwordConfirm &&
+ passwordConfirm.touched
+ "
+ [disabled]="!authData.params"
required
/>
@@ -58,7 +69,8 @@
0
+ (!isUserEmailValid(authData.mail) && authData.mail.length > 0) ||
+ !authData.params
"
>
diff --git a/frontend/src/app/components/auth/register/register.component.scss b/frontend/src/app/components/auth/register/register.component.scss
index 148f486..9aef02e 100644
--- a/frontend/src/app/components/auth/register/register.component.scss
+++ b/frontend/src/app/components/auth/register/register.component.scss
@@ -49,6 +49,14 @@ section {
font-size: 12px !important;
font-weight: 400 !important;
}
+ a {
+ color: $red;
+ text-decoration: underline;
+ cursor: pointer;
+ &:hover {
+ text-decoration: none;
+ }
+ }
}
.register-form {
@@ -77,4 +85,7 @@ section {
background-color: rgba($white, 0.1);
}
}
+ .error-border {
+ border: 1px solid red;
+ }
}
diff --git a/frontend/src/app/components/auth/register/register.component.ts b/frontend/src/app/components/auth/register/register.component.ts
index 3b58e89..4cd7e14 100644
--- a/frontend/src/app/components/auth/register/register.component.ts
+++ b/frontend/src/app/components/auth/register/register.component.ts
@@ -1,21 +1,34 @@
import { Component } from '@angular/core';
import { BtnLargeComponent } from '../../../shared/components/btn-large/btn-large.component';
import { FormsModule, NgForm } from '@angular/forms';
+import { ActivatedRoute, RouterLink } from '@angular/router';
@Component({
selector: 'app-register',
standalone: true,
- imports: [BtnLargeComponent, FormsModule],
+ imports: [BtnLargeComponent, FormsModule, RouterLink],
templateUrl: './register.component.html',
styleUrl: './register.component.scss',
})
export class RegisterComponent {
authData = {
- mail: 'test@test.de',
+ mail: '',
+ params: false,
password: '',
passwordConfirm: '',
};
+ constructor(private route: ActivatedRoute) {}
+
+ ngOnInit(): void {
+ this.route.queryParams.subscribe((params) => {
+ this.authData.mail = params['mail'] || '';
+ this.authData.mail
+ ? (this.authData.params = true)
+ : (this.authData.params = false);
+ });
+ }
+
isUserEmailValid(emailValue: string) {
const emailRegex = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/;
return emailRegex.test(emailValue);
diff --git a/frontend/src/app/components/home/home.component.ts b/frontend/src/app/components/home/home.component.ts
index 1b6912f..289efa7 100644
--- a/frontend/src/app/components/home/home.component.ts
+++ b/frontend/src/app/components/home/home.component.ts
@@ -2,8 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { HeaderComponent } from './header/header.component';
import { FooterComponent } from './footer/footer.component';
import { AuthComponent } from '../auth/auth.component';
-import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
-import { filter } from 'rxjs/operators';
+import { ActivatedRoute } from '@angular/router';
import { RegisterComponent } from '../auth/register/register.component';
@Component({