Skip to content

Commit

Permalink
[PM-4949] Update Accept Organization Invite Flow (#12202)
Browse files Browse the repository at this point in the history
* fix(accept-organization): Update accept organization invite flow

Removed old accept organization flow and updated stylings to tailwind.
  • Loading branch information
Patrick-Pimentel-Bitwarden authored Dec 24, 2024
1 parent 35f4edd commit ef70f7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,46 +1,13 @@
<div class="mt-5 d-flex justify-content-center" *ngIf="loading">
<div class="tw-mt-5 tw-flex tw-justify-center">
<div>
<img src="../../images/[email protected]" class="mb-4 logo" alt="Bitwarden" />
<p class="text-center">
<img src="../../images/[email protected]" class="logo" alt="Bitwarden" />
<p class="tw-text-center tw-my-4">
<i
class="bwi bwi-spinner bwi-spin bwi-2x text-muted"
class="bwi bwi-spinner bwi-spin bwi-2x tw-text-muted"
title="{{ 'loading' | i18n }}"
aria-hidden="true"
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</p>
</div>
</div>
<div class="container" *ngIf="!loading">
<div class="row justify-content-md-center mt-5">
<div class="col-5">
<p class="lead text-center mb-4">{{ "joinOrganization" | i18n }}</p>
<div class="card d-block">
<div class="card-body">
<p class="text-center">
{{ orgName$ | async }}
<strong class="d-block mt-2">{{ email }}</strong>
</p>
<p>{{ "joinOrganizationDesc" | i18n }}</p>
<hr />
<div class="d-flex">
<a
routerLink="/login"
[queryParams]="{ email: email }"
class="btn btn-primary btn-block"
>
{{ "logIn" | i18n }}
</a>
<a
[routerLink]="registerRoute$ | async"
[queryParams]="{ email: email }"
class="btn btn-primary btn-block ml-2 mt-0"
>
{{ "createAccount" | i18n }}
</a>
</div>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,14 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
async unauthedHandler(qParams: Params): Promise<void> {
const invite = OrganizationInvite.fromParams(qParams);
await this.acceptOrganizationInviteService.setOrganizationInvitation(invite);
await this.accelerateInviteAcceptIfPossible(invite);
await this.navigateInviteAcceptance(invite);
}

/**
* In certain scenarios, we want to accelerate the user through the accept org invite process
* For example, if the user has a BW account already, we want them to be taken to login instead of creation.
*/
private async accelerateInviteAcceptIfPossible(invite: OrganizationInvite): Promise<void> {
// if orgUserHasExistingUser is null, we can't determine the user's status
// so we don't want to accelerate the process
if (invite.orgUserHasExistingUser == null) {
return;
}

private async navigateInviteAcceptance(invite: OrganizationInvite): Promise<void> {
// if user exists, send user to login
if (invite.orgUserHasExistingUser) {
await this.router.navigate(["/login"], {
Expand Down

0 comments on commit ef70f7d

Please sign in to comment.