added logout on login
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Component, inject, signal, viewChild} from '@angular/core';
|
||||
import {Component, inject, OnInit, signal, viewChild} from '@angular/core';
|
||||
import {IonicModule, NavController, ToastController} from "@ionic/angular";
|
||||
import {SignInFormComponent} from "../../components/sign-in-form/sign-in-form.component";
|
||||
import {SignOnFormComponent} from "../../components/sign-on-form/sign-on-form.component";
|
||||
@@ -16,7 +16,7 @@ import {UsersService} from "../../services/api";
|
||||
SignOnFormComponent
|
||||
]
|
||||
})
|
||||
export class LoginComponent {
|
||||
export class LoginComponent implements OnInit {
|
||||
authState = signal<boolean>(true)
|
||||
errorMessage = signal<string | null>(null);
|
||||
login = viewChild<SignInFormComponent>('loginForm');
|
||||
@@ -27,6 +27,10 @@ export class LoginComponent {
|
||||
private navCtrl = inject(NavController);
|
||||
private toastCtrl = inject(ToastController);
|
||||
|
||||
ngOnInit() {
|
||||
this.authManageService.logout();
|
||||
}
|
||||
|
||||
async createAccount() {
|
||||
if (this.authState()) {
|
||||
this.authState.set(false);
|
||||
|
||||
Reference in New Issue
Block a user