Browse Source

Refactoring

pull/7175/head
Thomas Kaul 2 weeks ago
parent
commit
d3659d7239
  1. 10
      apps/client/src/app/services/web-authn.service.ts

10
apps/client/src/app/services/web-authn.service.ts

@ -42,12 +42,12 @@ export class WebAuthnService {
console.warn('Could not register device', error);
return of(null);
}),
switchMap((attOps) => {
if (!attOps) {
switchMap((registrationOptions) => {
if (!registrationOptions) {
throw new Error('Could not generate registration options');
}
return startRegistration({ optionsJSON: attOps });
return startRegistration({ optionsJSON: registrationOptions });
}),
switchMap((credential) => {
return this.http.post<AuthDeviceDto>(
@ -55,10 +55,10 @@ export class WebAuthnService {
{ credential }
);
}),
tap((authDevice) =>
tap(({ id }) =>
this.settingsStorageService.setSetting(
WebAuthnService.WEB_AUTH_N_DEVICE_ID,
authDevice.id
id
)
)
);

Loading…
Cancel
Save