2024-05-30 18:03:17 +02:00
|
|
|
import { Component, inject } from "@angular/core";
|
2022-02-03 06:00:57 +01:00
|
|
|
|
2023-02-06 22:53:37 +01:00
|
|
|
import { UpdatePasswordComponent as BaseUpdatePasswordComponent } from "@bitwarden/angular/auth/components/update-password.component";
|
2024-05-30 18:03:17 +02:00
|
|
|
|
|
|
|
import { RouterService } from "../core";
|
|
|
|
|
|
|
|
import { AcceptOrganizationInviteService } from "./organization-invite/accept-organization.service";
|
2022-02-03 06:00:57 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "app-update-password",
|
|
|
|
templateUrl: "update-password.component.html",
|
|
|
|
})
|
|
|
|
export class UpdatePasswordComponent extends BaseUpdatePasswordComponent {
|
2024-05-30 18:03:17 +02:00
|
|
|
private routerService = inject(RouterService);
|
|
|
|
private acceptOrganizationInviteService = inject(AcceptOrganizationInviteService);
|
|
|
|
|
|
|
|
override async cancel() {
|
|
|
|
// clearing the login redirect url so that the user
|
|
|
|
// does not join the organization if they cancel
|
|
|
|
await this.routerService.getAndClearLoginRedirectUrl();
|
|
|
|
await this.acceptOrganizationInviteService.clearOrganizationInvitation();
|
|
|
|
await super.cancel();
|
2022-02-03 06:00:57 +01:00
|
|
|
}
|
|
|
|
}
|