diff --git a/frontend/src/app/pages/login/login.component.html b/frontend/src/app/pages/login/login.component.html index b201063..2670023 100644 --- a/frontend/src/app/pages/login/login.component.html +++ b/frontend/src/app/pages/login/login.component.html @@ -5,7 +5,7 @@
+
You have been successfully logged out.
diff --git a/frontend/src/app/pages/login/login.component.ts b/frontend/src/app/pages/login/login.component.ts index 40886ce..c484bed 100644 --- a/frontend/src/app/pages/login/login.component.ts +++ b/frontend/src/app/pages/login/login.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { StateService } from '../../services/state.service'; @@ -10,16 +10,23 @@ import { SessionOperation } from '../../operations/session.operation'; templateUrl: './login.component.html', styleUrls: ['./login.component.scss'] }) -export class LoginComponent { +export class LoginComponent implements OnInit { + public loginForm: FormGroup; public loginError = false; + public isLogoutPage = false; + constructor(private router: Router, private fb: FormBuilder, public gs: StateService, private sessions: SessionOperation, private route: ActivatedRoute) { this.createForm(); } + ngOnInit(): void { + this.route.data.subscribe((data) => this.isLogoutPage = data.logout); + } + private createForm() { this.loginForm = this.fb.group({ username: ['', Validators.required], @@ -37,8 +44,4 @@ export class LoginComponent { this.loginError = true; } } - - public isLogoutPage() { - return this.route.snapshot.data.logout; - } }