This commit is contained in:
Peter Maquiran
2021-09-27 16:23:41 +01:00
parent c13080d2ad
commit 50bb9120b5
423 changed files with 126597 additions and 312 deletions
+9 -1
View File
@@ -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);