This commit is contained in:
Peter Maquiran
2022-12-22 11:01:58 +01:00
parent 7168788b3c
commit e6caab4aaf
45 changed files with 7182 additions and 4145 deletions
+7 -20
View File
@@ -11,11 +11,11 @@ import { ClearStoreService } from 'src/app/services/clear-store.service';
import { ChangeProfileService } from 'src/app/services/change-profile.service';
import { ThemeService } from 'src/app/services/theme.service';
import { PermissionService } from 'src/app/services/permission.service';
import { PermissionList } from 'src/app/models/permission/permissionList';
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
import { ChatService } from 'src/app/services/chat.service';
import { Platform } from '@ionic/angular';
@Component({
@@ -50,8 +50,7 @@ export class LoginPage implements OnInit {
public p: PermissionService,
private RochetChatConnectorService: RochetChatConnectorService,
public ChatSystemService: ChatSystemService,
private ChatService: ChatService,
private platform: Platform,
private ChatService: ChatService
) {}
ngOnInit() {
@@ -102,7 +101,6 @@ export class LoginPage implements OnInit {
async Login() {
if (this.validateUsername()) {
if(this.validatePassword()) {
@@ -131,7 +129,7 @@ export class LoginPage implements OnInit {
this.ChatSystemService.loadChat();
}
this.changeProfileService.runLogin();
this.getToken();
SessionStore.setInativity(true);
@@ -140,16 +138,16 @@ export class LoginPage implements OnInit {
} else {
this.RochetChatConnectorService.logout();
this.clearStoreService.clear();
this.ChatSystemService.clearChat();
SessionStore.delete();
window.localStorage.clear();
await MessageModel.deleteAll();
await DeleteMessageModel.deleteAll();
await MessageModel.deleteAll()
await DeleteMessageModel.deleteAll()
await this.authService.SetSession(attempt, this.userattempt);
this.changeProfileService.run();
@@ -161,18 +159,7 @@ export class LoginPage implements OnInit {
this.getToken();
if(!this.platform.is('desktop') && !this.platform.is('mobileweb')) {
if(this.sessionStore.hasPin) {
this.router.navigateByUrl('/home/events');
} else {
this.router.navigateByUrl('/pin', { replaceUrl: true });
}
} else {
this.router.navigate(['/home/events']);
}
this.router.navigateByUrl('/pin', { replaceUrl: true });
}
}
else{