From 56ff34f4f51400b0085d350f9cf89ebfe33d785a Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Mon, 14 Jun 2021 19:59:59 +0200 Subject: [PATCH] Various improvements --- apps/api/src/app/auth/web-auth.service.ts | 4 ++-- apps/client/src/app/app-routing.module.ts | 10 ++++----- .../components/header/header.component.html | 5 ----- .../pages/webauthn/webauthn-page.component.ts | 12 +++++------ .../src/app/pages/webauthn/webauthn-page.html | 21 +++++++++++-------- .../pages/webauthn/webauthn-page.module.ts | 10 ++++----- 6 files changed, 30 insertions(+), 32 deletions(-) diff --git a/apps/api/src/app/auth/web-auth.service.ts b/apps/api/src/app/auth/web-auth.service.ts index e17ffc639..157f75e36 100644 --- a/apps/api/src/app/auth/web-auth.service.ts +++ b/apps/api/src/app/auth/web-auth.service.ts @@ -58,8 +58,8 @@ export class WebAuthService { attestationType: 'indirect', authenticatorSelection: { authenticatorAttachment: 'platform', - userVerification: 'required', - requireResidentKey: false + requireResidentKey: false, + userVerification: 'required' } }; diff --git a/apps/client/src/app/app-routing.module.ts b/apps/client/src/app/app-routing.module.ts index d9c395f7a..9faf0553f 100644 --- a/apps/client/src/app/app-routing.module.ts +++ b/apps/client/src/app/app-routing.module.ts @@ -92,11 +92,6 @@ const routes: Routes = [ (m) => m.TransactionsPageModule ) }, - { - path: 'zen', - loadChildren: () => - import('./pages/zen/zen-page.module').then((m) => m.ZenPageModule) - }, { path: 'webauthn', loadChildren: () => @@ -104,6 +99,11 @@ const routes: Routes = [ (m) => m.WebauthnPageModule ) }, + { + path: 'zen', + loadChildren: () => + import('./pages/zen/zen-page.module').then((m) => m.ZenPageModule) + }, { // wildcard, if requested url doesn't match any paths for routes defined // earlier diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html index a85e2636a..9d566f7de 100644 --- a/apps/client/src/app/components/header/header.component.html +++ b/apps/client/src/app/components/header/header.component.html @@ -1,9 +1,4 @@ - - - - - diff --git a/apps/client/src/app/pages/webauthn/webauthn-page.component.ts b/apps/client/src/app/pages/webauthn/webauthn-page.component.ts index 38ce6f621..431e4bc81 100644 --- a/apps/client/src/app/pages/webauthn/webauthn-page.component.ts +++ b/apps/client/src/app/pages/webauthn/webauthn-page.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; import { TokenStorageService } from '@ghostfolio/client/services/token-storage.service'; import { WebAuthnService } from '@ghostfolio/client/services/web-authn.service'; -import { Router } from '@angular/router'; @Component({ selector: 'gf-webauthn-page', @@ -18,14 +18,14 @@ export class WebauthnPageComponent implements OnInit { private webAuthnService: WebAuthnService ) {} - ngOnInit(): void { + public ngOnInit() { this.signIn(); } public deregisterDevice() { - this.webAuthnService - .deregister() - .subscribe(() => this.router.navigate([''])); + this.webAuthnService.deregister().subscribe(() => { + this.router.navigate(['/']); + }); } public signIn() { @@ -34,7 +34,7 @@ export class WebauthnPageComponent implements OnInit { this.webAuthnService.login().subscribe( ({ authToken }) => { this.tokenStorageService.saveToken(authToken, false); - this.router.navigate(['']); + this.router.navigate(['/']); }, (error) => { console.error(error); diff --git a/apps/client/src/app/pages/webauthn/webauthn-page.html b/apps/client/src/app/pages/webauthn/webauthn-page.html index 1c12f1fa0..02650bd7c 100644 --- a/apps/client/src/app/pages/webauthn/webauthn-page.html +++ b/apps/client/src/app/pages/webauthn/webauthn-page.html @@ -1,23 +1,26 @@
-
+
- +
-
-

- Authentication failed +
+

+ Oops, authentication failed

-

diff --git a/apps/client/src/app/pages/webauthn/webauthn-page.module.ts b/apps/client/src/app/pages/webauthn/webauthn-page.module.ts index e4e392400..01a7dcd4b 100644 --- a/apps/client/src/app/pages/webauthn/webauthn-page.module.ts +++ b/apps/client/src/app/pages/webauthn/webauthn-page.module.ts @@ -1,19 +1,19 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { WebauthnPageComponent } from '@ghostfolio/client/pages/webauthn/webauthn-page.component'; import { WebauthnPageRoutingModule } from './webauthn-page-routing.module'; -import { WebauthnPageComponent } from '@ghostfolio/client/pages/webauthn/webauthn-page.component'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatButtonModule } from '@angular/material/button'; @NgModule({ declarations: [WebauthnPageComponent], exports: [], imports: [ - WebauthnPageRoutingModule, CommonModule, MatButtonModule, - MatProgressSpinnerModule + MatProgressSpinnerModule, + WebauthnPageRoutingModule ], providers: [] })