diff --git a/src/app/accounts/login.component.html b/src/app/accounts/login.component.html index 2cc33690..132bc0d0 100644 --- a/src/app/accounts/login.component.html +++ b/src/app/accounts/login.component.html @@ -1,3 +1,8 @@ -
diff --git a/src/app/accounts/login.component.ts b/src/app/accounts/login.component.ts index 55523cbf..70a1683e 100644 --- a/src/app/accounts/login.component.ts +++ b/src/app/accounts/login.component.ts @@ -5,6 +5,8 @@ import { OnInit, } from '@angular/core'; +import { Router } from '@angular/router'; + import { AuthService } from 'jslib/abstractions/auth.service'; @Component({ @@ -12,11 +14,19 @@ import { AuthService } from 'jslib/abstractions/auth.service'; template: template }) export class LoginComponent implements OnInit { - constructor(authService: AuthService) { - console.log(authService); + email: string = ''; + masterPassword: string = ''; + + constructor(private authService: AuthService, private router: Router) { + } ngOnInit() { // TODO? } + + async onSubmit() { + const response = await this.authService.logIn(this.email, this.masterPassword); + this.router.navigate(['vault']); + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 88a38235..e88960e0 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,6 +3,7 @@ import 'zone.js/dist/zone'; import { AppRoutingModule } from './app-routing.module'; import { BrowserModule } from '@angular/platform-browser'; +import { FormsModule } from '@angular/forms'; import { NgModule } from '@angular/core'; import { ServicesModule } from './services/services.module'; @@ -13,6 +14,7 @@ import { VaultComponent } from './vault/vault.component'; @NgModule({ imports: [ BrowserModule, + FormsModule, AppRoutingModule, ServicesModule, ], diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 5343a8d4..f5f78a68 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -1,4 +1,4 @@ -//import { remote } from 'electron'; +import { webFrame } from 'electron'; import { NgModule } from '@angular/core'; @@ -50,6 +50,8 @@ import { UtilsService as UtilsServiceAbstraction, } from 'jslib/abstractions'; +webFrame.registerURLSchemeAsPrivileged('file'); + const utilsService = new UtilsService(); const platformUtilsService = new DesktopPlatformUtilsService(); const messagingService = new DesktopMessagingService(); @@ -82,11 +84,19 @@ const authService: AuthServiceAbstraction = new AuthService(cryptoService, apiSe userService, tokenService, appIdService, platformUtilsService, constantsService, messagingService); +containerService.attachToWindow(window); +environmentService.setUrlsFromStorage().then(() => { + return syncService.fullSync(true); +}); + @NgModule({ imports: [], declarations: [], providers: [ { provide: AuthServiceAbstraction, useValue: authService }, + { provide: CipherServiceAbstraction, useValue: cipherService }, + { provide: FolderServiceAbstraction, useValue: folderService }, + { provide: CollectionServiceAbstraction, useValue: collectionService }, ], }) export class ServicesModule { diff --git a/src/app/vault/vault.component.html b/src/app/vault/vault.component.html index 4f7866b8..116cfe9e 100644 --- a/src/app/vault/vault.component.html +++ b/src/app/vault/vault.component.html @@ -26,13 +26,15 @@