Skip to content

Commit

Permalink
fix: Call vault migration on onboarding's end
Browse files Browse the repository at this point in the history
In a previous commit we changed the bitwarden client's type from
`webapp` to `web`

This had a side effect on onboarding that would not trigger migration
from konnectors accounts to ciphers as this is prevented on `web`
clients (because cozy-keys-lib is also flagged as a `web` client)

This is a requirement for setting `extension_installed` flag to `true`

The result was the onboarding screen to be always displayed when
accessing cozy-pass-web

To fix this, the cozy-stack now has a new entry point `/settings/vault`
that allows to enforce the migration from cozy-pass-web even if its
client is a `web` one

We want to call this endpoint at the end of onboarding

Related PR: #109
Related PR: cozy/cozy-stack#4285
Related PR: cozy/cozy-stack#4303
  • Loading branch information
Ldoppea committed Jan 23, 2024
1 parent f58c6b8 commit 42ff7fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/cozy/services/installation-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ export class VaultInstallationService {
}
}

setIsInstalled() {
async completeVaultConfiguration() {
const client = this.clientService.GetClient();
await client.stackClient.fetchJSON(
'POST',
'/settings/vault'
);
this.userFinishedInstallation = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export class InstallationPageComponent extends AngularWrapperComponent implement
/* Props Bindings */
/******************/

protected onSkipExtension() {
this.vaultInstallationService.setIsInstalled();
protected async onSkipExtension() {
await this.vaultInstallationService.completeVaultConfiguration();
this.messagingService.send('installed');
}

Expand Down

0 comments on commit 42ff7fe

Please sign in to comment.