Files
doneit-web/.angular/cache/14.2.12/babel-webpack/a316d1861b7dffaea83714afef90cc5d.json
T

1 line
18 KiB
JSON
Raw Normal View History

2023-06-30 09:54:21 +01:00
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./inactivity.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./inactivity.page.scss?ngResource\";\nimport { Component } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { AuthService } from 'src/app/services/auth.service';\nimport { ToastService } from 'src/app/services/toast.service';\nimport { environment } from 'src/environments/environment';\nimport { AlertController } from '@ionic/angular';\nimport { NotificationsService } from 'src/app/services/notifications.service';\nimport { SessionStore } from 'src/app/store/session.service';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { PermissionService } from 'src/app/services/permission.service';\nlet InactivityPage = class InactivityPage {\n constructor(notificatinsservice, router, authService, toastService, alertController, ThemeService, p) {\n this.notificatinsservice = notificatinsservice;\n this.router = router;\n this.authService = authService;\n this.toastService = toastService;\n this.alertController = alertController;\n this.ThemeService = ThemeService;\n this.p = p;\n this.username = environment.defaultuser;\n this.password = environment.defaultuserpwd;\n this.code = [];\n this.setPin = false;\n this.SessionStore = SessionStore;\n this.enterWithPassword = false;\n this.loop = false;\n }\n ngOnInit() {}\n runloop() {}\n presentAlert(message) {\n var _this = this;\n return _asyncToGenerator(function* () {\n const alert = yield _this.alertController.create({\n cssClass: 'my-custom-class',\n header: 'Mensagem do sistema',\n message: message,\n buttons: ['OK']\n });\n yield alert.present();\n })();\n }\n //Function to validade the login inputs\n validateUsername() {\n return this.username.trim().length > 0;\n }\n validatePassword() {\n return this.password.trim().length > 0;\n }\n Login() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n if (_this2.validateUsername()) {\n if (_this2.validatePassword()) {\n _this2.userattempt = {\n username: _this2.username,\n password: _this2.password,\n domainName: environment.domain,\n BasicAuthKey: \"\"\n };\n let attempt = yield _this2.authService.login(_this2.userattempt, {\n saveSession: false\n });\n if (attempt) {\n // if current attemp is equal to the current user\n if (attempt.UserId == SessionStore.user.UserId) {\n yield _this2.authService.SetSession(attempt, _this2.userattempt);\n if (_this2.p.userPermission(_this2.p.permissionList.Chat.access)) {\n // this.authService.loginChat();\n }\n _this2.getToken();\n SessionStore.setInativity(true);\n _this2.goback();\n } else {\n SessionStore.delete();\n window.localStorage.clear();\n SessionStore.setInativity(true);\n yield _this2.authService.SetSession(attempt, _this2.userattempt);\n }\n _this2.enterWithPassword = false;\n }\n } else {\n _this2.toastService._badRequest('Por favor, insira a sua palavra-passe');\n }\n } else {\n _this2.toastService._badRequest('Por favor, insira o seu nome de utilizador');\n }\n })();\n }\n getToken() {\n this.notificatinsservice.requestPermissions();\n this.notificatinsservice.registrationError();\n this.notificatinsservice.getAndpostToken(this.username);\n }\n setCode(code) {\n if (this.code.length < 4) {\n this.code.push(code);\n }\n if (this.code.length == 4) {\n if (!SessionStore.hasPin) {\n // \n this