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 {IonicModule, NavController, ToastController} from "@ionic/angular";
|
||||||
import {SignInFormComponent} from "../../components/sign-in-form/sign-in-form.component";
|
import {SignInFormComponent} from "../../components/sign-in-form/sign-in-form.component";
|
||||||
import {SignOnFormComponent} from "../../components/sign-on-form/sign-on-form.component";
|
import {SignOnFormComponent} from "../../components/sign-on-form/sign-on-form.component";
|
||||||
@@ -16,7 +16,7 @@ import {UsersService} from "../../services/api";
|
|||||||
SignOnFormComponent
|
SignOnFormComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class LoginComponent {
|
export class LoginComponent implements OnInit {
|
||||||
authState = signal<boolean>(true)
|
authState = signal<boolean>(true)
|
||||||
errorMessage = signal<string | null>(null);
|
errorMessage = signal<string | null>(null);
|
||||||
login = viewChild<SignInFormComponent>('loginForm');
|
login = viewChild<SignInFormComponent>('loginForm');
|
||||||
@@ -27,6 +27,10 @@ export class LoginComponent {
|
|||||||
private navCtrl = inject(NavController);
|
private navCtrl = inject(NavController);
|
||||||
private toastCtrl = inject(ToastController);
|
private toastCtrl = inject(ToastController);
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.authManageService.logout();
|
||||||
|
}
|
||||||
|
|
||||||
async createAccount() {
|
async createAccount() {
|
||||||
if (this.authState()) {
|
if (this.authState()) {
|
||||||
this.authState.set(false);
|
this.authState.set(false);
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Be Ready</title>
|
<title>BeReady</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="BeReady.png">
|
<link rel="icon" type="image/x-icon" href="BeReady.png">
|
||||||
|
|||||||
Reference in New Issue
Block a user