mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-23 02:31:26 +01:00
[PM-4949] Update Accept Organization Invite Flow (#12202)
* fix(accept-organization): Update accept organization invite flow Removed old accept organization flow and updated stylings to tailwind.
This commit is contained in:
parent
35f4edddcf
commit
ef70f7ddce
@ -1,9 +1,9 @@
|
||||
<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/logo-dark@2x.png" class="mb-4 logo" alt="Bitwarden" />
|
||||
<p class="text-center">
|
||||
<img src="../../images/logo-dark@2x.png" 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>
|
||||
@ -11,36 +11,3 @@
|
||||
</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>
|
||||
|
@ -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"], {
|
||||
|
Loading…
Reference in New Issue
Block a user