Browse Source

Refactoring

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

14
apps/client/src/app/services/user/user.service.ts

@ -128,10 +128,18 @@ export class UserService extends ObservableStore<UserStoreState> {
const cookies = await cookieStore.getAll(); const cookies = await cookieStore.getAll();
const cookieNames = cookies const cookieNames = cookies
.map(({ name }) => name) .map(({ name }) => {
.filter((name): name is string => !!name); return name;
})
.filter((name): name is string => {
return !!name;
});
await Promise.all(cookieNames.map((name) => cookieStore.delete(name))); await Promise.all(
cookieNames.map((name) => {
return cookieStore.delete(name);
})
);
} }
private fetchUser(): Observable<User> { private fetchUser(): Observable<User> {

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

@ -46,6 +46,7 @@ export class WebAuthnService {
if (!attOps) { if (!attOps) {
throw new Error('Could not generate registration options'); throw new Error('Could not generate registration options');
} }
return startRegistration({ optionsJSON: attOps }); return startRegistration({ optionsJSON: attOps });
}), }),
switchMap((credential) => { switchMap((credential) => {

Loading…
Cancel
Save