Feature/upgrade simplewebauthn dependencies to version 4.1.0 (#365)

* Upgrade @simplewebauthn dependencies to version 4.1.0
  * @simplewebauthn/browser
  * @simplewebauthn/server

* Update changelog
This commit is contained in:
Thomas Kaul
2021-09-11 21:23:06 +02:00
committed by GitHub
parent 39f315aba0
commit 5ea455b98b
7 changed files with 79 additions and 68 deletions

View File

@@ -2,8 +2,8 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { GfLogoModule } from '@ghostfolio/ui/logo';
import { WebauthnPageComponent } from '@ghostfolio/client/pages/webauthn/webauthn-page.component';
import { GfLogoModule } from '@ghostfolio/ui/logo';
import { WebauthnPageRoutingModule } from './webauthn-page-routing.module';

View File

@@ -6,7 +6,10 @@ import {
PublicKeyCredentialRequestOptionsJSON
} from '@ghostfolio/api/app/auth/interfaces/simplewebauthn';
import { SettingsStorageService } from '@ghostfolio/client/services/settings-storage.service';
import { startAssertion, startAttestation } from '@simplewebauthn/browser';
import {
startAuthentication,
startRegistration
} from '@simplewebauthn/browser';
import { of } from 'rxjs';
import { catchError, switchMap, tap } from 'rxjs/operators';
@@ -32,7 +35,7 @@ export class WebAuthnService {
public register() {
return this.http
.get<PublicKeyCredentialCreationOptionsJSON>(
`/api/auth/webauthn/generate-attestation-options`,
`/api/auth/webauthn/generate-registration-options`,
{}
)
.pipe(
@@ -41,7 +44,7 @@ export class WebAuthnService {
return of(null);
}),
switchMap((attOps) => {
return startAttestation(attOps);
return startRegistration(attOps);
}),
switchMap((attResp) => {
return this.http.post<AuthDeviceDto>(
@@ -83,7 +86,7 @@ export class WebAuthnService {
{ deviceId }
)
.pipe(
switchMap(startAssertion),
switchMap(startAuthentication),
switchMap((assertionResponse) => {
return this.http.post<{ authToken: string }>(
`/api/auth/webauthn/verify-assertion`,