1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 20:50:28 +00:00
Files
browser/libs/auth/src/angular/login/login-component.service.ts
rr-bw 46046ca1fa fix(change-password-prompt) [Auth/PM-22356] Scope org invite email to submitted email (#15783)
Adds a check to make sure that the email on the Org Invite matches the email submitted in the form. If it matches, only then do we apply the org invite to get the MP policies. But if the emails do not match, it means the user attempting to login is no longer the user who originally clicked the emailed org invite link. Therefore, we clear the Org Invite + Deep Link and allow the user to login as normal.
2025-08-07 08:19:35 -07:00

43 lines
1.4 KiB
TypeScript

// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options";
import { Policy } from "@bitwarden/common/admin-console/models/domain/policy";
export interface PasswordPolicies {
policies: Policy[];
isPolicyAndAutoEnrollEnabled: boolean;
enforcedPasswordPolicyOptions: MasterPasswordPolicyOptions;
}
/**
* The `LoginComponentService` allows the single libs/auth `LoginComponent` to
* delegate all client-specific functionality to client-specific service
* implementations of `LoginComponentService`.
*
* The `LoginComponentService` should not be confused with the
* `LoginStrategyService`, which is used to determine the login strategy and
* performs the core login logic.
*/
export abstract class LoginComponentService {
/**
* Gets the organization policies if there is an organization invite.
* - Used by: Web
*/
getOrgPoliciesFromOrgInvite?: (email: string) => Promise<PasswordPolicies | null>;
/**
* Indicates whether login with passkey is supported on the given client
*/
isLoginWithPasskeySupported: () => boolean;
/**
* Redirects the user to the SSO login page, either via route or in a new browser window.
*/
redirectToSsoLogin: (email: string) => Promise<void | null>;
/**
* Shows the back button.
*/
showBackButton: (showBackButton: boolean) => void;
}