mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Fix
This commit is contained in:
@@ -7,6 +7,7 @@ import { environment } from 'src/environments/environment';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ClearStoreService } from 'src/app/services/clear-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -31,7 +32,8 @@ export class LoginPage implements OnInit {
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
public alertController: AlertController
|
||||
public alertController: AlertController,
|
||||
private clearStoreService: ClearStoreService
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -76,9 +78,13 @@ export class LoginPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
let attempt = await this.authService.login(this.userattempt, {saveSession: false})
|
||||
|
||||
loader.remove()
|
||||
|
||||
if (attempt) {
|
||||
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
@@ -89,6 +95,8 @@ export class LoginPage implements OnInit {
|
||||
|
||||
this.goback()
|
||||
} else {
|
||||
|
||||
this.clearStoreService.clear()
|
||||
SessionStore.delete()
|
||||
window.localStorage.clear();
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
|
||||
Reference in New Issue
Block a user