diff --git a/src/app/app.component.html b/src/app/app.component.html index ff953c9..2d423dd 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -19,17 +19,16 @@ - - - + + +
-
+
DiscoTrip @@ -66,11 +65,9 @@
-
+
- @@ -90,4 +87,4 @@ - + \ No newline at end of file diff --git a/src/app/core/services/auth/auth.service.ts b/src/app/core/services/auth/auth.service.ts index 3ae0eff..dd34be5 100644 --- a/src/app/core/services/auth/auth.service.ts +++ b/src/app/core/services/auth/auth.service.ts @@ -25,11 +25,21 @@ export class AuthService { }) } - async login(email: string, password: string) { + async register(email: string, password: string) { + try { + await this.afAuth.auth.createUserWithEmailAndPassword(email, password) + alert("Thank you: " + email + " for registering on DiscoTrip") + this.router.navigate(['/']); + } catch (e) { + alert("Error!" + e.message); + } + } + async login(email: string, password: string) { try { await this.afAuth.auth.signInWithEmailAndPassword(email, password) - this.router.navigate(['register/list']); + alert("User: " + email + " is connected") + this.router.navigate(['/']); } catch (e) { alert("Error!" + e.message); } @@ -38,7 +48,7 @@ export class AuthService { async logout(){ await this.afAuth.auth.signOut(); localStorage.removeItem('user'); - this.router.navigate(['/register']); + alert("Thank you for using DiscoTrip, see you soon") } get isLoggedIn(): boolean { diff --git a/src/app/register/register.component.html b/src/app/register/register.component.html index fda50cf..cb11137 100644 --- a/src/app/register/register.component.html +++ b/src/app/register/register.component.html @@ -1,23 +1,22 @@
-
-
-
-
Login
-
-
-
- -
-
- - - - - -
-
-
-
-
-
+
+
+
+
Login
+
+
+
+ +
+
+ + + + +
+
+
+
+
+
\ No newline at end of file