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AAe,iVAAiV,kBAAkB,mBAAmB,+BAA+B,8BAA8B,qUAAqU,cAAc,23EAA23E","sources":["./src/app/pages/authorise-email/authorise-email-routing.module.ts","./src/app/pages/authorise-email/authorise-email.module.ts","./src/app/pages/authorise-email/authorise-email.page.ts","./src/app/pages/authorise-email/authorise-email.page.html"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { AuthoriseEmailPage } from './authorise-email.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: AuthoriseEmailPage\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class AuthoriseEmailPageRoutingModule {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { IonicModule } from '@ionic/angular';\n\nimport { AuthoriseEmailPageRoutingModule } from './authorise-email-routing.module';\n\nimport { AuthoriseEmailPage } from './authorise-email.page';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n IonicModule,\n AuthoriseEmailPageRoutingModule\n ],\n declarations: [AuthoriseEmailPage]\n})\nexport class AuthoriseEmailPageModule {}\n","import { Component, OnInit } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\n\nimport { SettingsService } from 'src/app/services/settings.service';\n\n@Component({\n selector: 'app-authorise-email',\n templateUrl: './authorise-email.page.html',\n styleUrls: ['./authorise-email.page.scss'],\n})\nexport class AuthoriseEmailPage implements OnInit {\n public errorMessage: string = '';\n public errorReturned: boolean=false;\n public mainForm: boolean=true;\n public securityError: boolean=false;\n public credentialsForm: FormGroup = new FormGroup({});\n public networkConnected: boolean=true;\n public authorised: boolean=true;\n public authenticated: boolean=false;\n public result: any = {\"Success\":false, \"Message\":\"\", \"Data\":{}};\n\n constructor(\n private formBuilder: FormBuilder,\n public settings: SettingsService \n ) { \n this.settings.log(1,'AuthoriseEmailPage constructor start');\n\n this.credentialsForm = this.formBuilder.group({\n email: ['', Validators.required],\n tc: ['', Validators.requiredTrue]\n }); \n\n this.settings.log(1,'AuthoriseEmailPage before tc');\n this.credentialsForm.controls['tc'].setValue(false);\n\n // we need to watch for changing network status \n this.settings.platform.ready().then(() => {\n this.networkConnected = this.settings.isConnected();\n this.settings.configureMatomoAndFirebase();\n this.mainForm = this.networkConnected;\n this.settings.log(1,'AuthoriseEmailPage this.networkConnected=' + this.networkConnected); \n });\n this.settings.userAuthorised().then((authorised:boolean)=>{\n this.authorised = authorised;\n this.settings.log(1,'AuthoriseEmailPage userAuthorised authorised=' + authorised); \n this.authenticated = this.settings.userAuthenticated;\n }).catch((error)=>{\n this.settings.log(2,'*** AuthoriseEmailPage userAuthorised ERROR ' + JSON.stringify(error));\n }); \n }\n\n ngOnInit() {\n }\n \n ionViewWillEnter() {\n this.settings.log(1,'ionViewWillEnter AuthoriseEmailPage appType=' + this.settings.appType);\n if (this.settings.appType == 'public') {\n this.settings.openPage('HomePage');\n } else {\n // 20211208 GR added to deal with secure storage checking before initial App authentication\n // We check for specific condition for the private app here: \n // when forcePrivateAndroidAppToSetScreenLock is true but secure storage can not be read \n // probably because it is Android device without a screen lock\n this.settings.getSecureStorage().then((storage)=>{\n this.settings.log(1,'ionViewWillEnter AuthoriseEmailPage check getSecureStorage - success');\n }).catch((error)=>{\n if (this.settings.forcePrivateAndroidAppToSetScreenLock) {\n this.securityError = true;\n this.mainForm = false;\n }\n this.settings.log(1,'ionViewWillEnter AuthoriseEmailPage check getSecureStorage - error forcePrivateAndroidAppToSetScreenLock=' + this.settings.forcePrivateAndroidAppToSetScreenLock);\n });\n // We also might be here because one can not read App data for previously authenticated private app. It may happen \n // either when cryptokey can not be read from secure storage (e.g. when android security changed) or\n // when secure storage is not used (forcePrivateAndroidAppToSetScreenLock=false) but cryptokey can not be read from\n // the server (e.g. network or server issue). We want to display corresponding errorMessage in those cases\n this.errorMessage = this.settings.authorisationErrorMessage;\n this.settings.log(1,'ionViewWillEnter AuthoriseEmailPage errorMessage=' + this.errorMessage);\n if (this.errorMessage) {\n this.errorReturned = true;\n } else {\n this.errorReturned = false;\n }\n } \n // track GA page views\n this.settings.trackPageView('Activate by Email'); \n }\n\n authoriseEmail() {\n this.errorMessage = 'Validating email. Please wait ...';\n this.errorReturned = true;\n this.settings.currentActivationEmail = this.credentialsForm.controls['email'].value;\n this.settings.currentPrivateKey = this.settings.getRandomString(12,'');\n this.settings.authorisationStarted();\n let commandParameters = 'u=' + encodeURIComponent(this.settings.currentActivationEmail) + \n '&pri=' + this.settings.currentPrivateKey;\n this.settings.executeCommand('sendactivationkey', commandParameters)\n .subscribe(result => { \n this.result = result;\n this.settings.log(0,'authorise http post result=' + JSON.stringify(this.result));\n if (this.result && this.result.Success) {\n this.errorMessage = '';\n this.errorReturned = false; \n this.settings.trackMatomoEvent(\"Management\", \"Activate\", \"App Activation - Step 1 Send Activation Email\", null);\n this.settings.lastActivationKeyReceivedDate = Date.now(); \n this.settings.openPage('AuthoriseKeyPage');\n } else {\n // display error message\n this.settings.trackMatomoEvent(\"Management\", \"Activate\", \"App Activation - Step 1 Send Activation Email Failure\", null);\n this.errorReturned = true;\n this.errorMessage = this.result.Message;\n this.settings.log(2,'authoriseEmail error message=' + this.result.Message);\n }\n }, error => {\n this.settings.trackMatomoEvent(\"Management\", \"Activate\", \"App Activation - Step 1 Send Activation Email Failure 2\", null);\n this.settings.log(2,'authoriseEmail server error ' + JSON.stringify(error));\n this.result.Message = \"Error connecting to the site\";\n this.errorReturned = true;\n this.errorMessage = this.result.Message;\n });\n } \n}\n","export default \"\\n \\n Activate by Email\\n \\n\\n\\n\\n\\n \\n\\n \\n \\n \\n \\n {{settings.appsettings.appName}}\\n \\n \\n Enter any email address that you have previously nominated to activate the App. \\n \\n \\n We will email you an activation code.\\n \\n \\n \\n\\n \\n {{errorMessage}}\\n \\n\\n \\n \\n \\n Email\\n \\n \\n\\n \\n I agree with Terms and Conditions\\n \\n \\n \\n \\n Read the Terms & Conditions\\n \\n \\n \\n \\n Forgotten your password \\n or not registered?\\n \\n Visit connect auto parts site\\n \\n \\n \\n \\n \\n \\n Receive Activation Code\\n \\n\\n \\n Which email address should I use?\\n \\n \\n \\n \\n \\n\\n \\n\\n\\n \\n To authorise access to this application an internet connection is required.\\n Please make sure that either wifi or data connection is available.\\n \\n \\n \\n Security Validation Error\\n This application requires secure device lock. Please enable screen locking and restart the application.\\n \\n\\n\\n\";"],"names":[],"sourceRoot":"webpack:///"}
\\n Enter any email address that you have previously nominated to activate the App. \\n
\\n We will email you an activation code.\\n
\\n Forgotten your password \\n or not registered?
\\n Which email address should I use?\\n