From 6bbbfcd14513b87a1bd50ff7300ff1184c495fb5 Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Sat, 14 Sep 2024 13:47:10 -0700 Subject: [PATCH] add jsdocs to LoginComponentService --- .../login/default-login-component.service.ts | 11 +++---- .../angular/login/login-component.service.ts | 29 +++++++++++++++++-- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/libs/auth/src/angular/login/default-login-component.service.ts b/libs/auth/src/angular/login/default-login-component.service.ts index 5a532c81f4..074bf6c0f7 100644 --- a/libs/auth/src/angular/login/default-login-component.service.ts +++ b/libs/auth/src/angular/login/default-login-component.service.ts @@ -19,21 +19,18 @@ export class DefaultLoginComponentService implements LoginComponentService { protected ssoLoginService: SsoLoginServiceAbstraction, ) {} - // Web - setPreviousUrl(route: UrlTree): void | null { - return null; - } - async getOrgPolicies(): Promise { return null; } - // Web/Browser + setPreviousUrl(route: UrlTree): void | null { + return null; + } + getShowPasswordlessFlag(): boolean { return null; } - // Used on Browser and overriden on Desktop async launchSsoBrowserWindow( email: string, clientId: "browser" | "desktop", diff --git a/libs/auth/src/angular/login/login-component.service.ts b/libs/auth/src/angular/login/login-component.service.ts index b5a7838139..c9dd3a663b 100644 --- a/libs/auth/src/angular/login/login-component.service.ts +++ b/libs/auth/src/angular/login/login-component.service.ts @@ -9,14 +9,37 @@ export interface PasswordPolicies { 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 { - // Web + /** + * Gets the organization policies if there is an organization invite. + * - Used by: Web + */ getOrgPolicies: () => Promise; + + /** + * Sets the previous URL to keep track of in memory. + * - Used by: Web + */ setPreviousUrl: (route: UrlTree) => void | null; - // Web/Browser + /** + * Gets the status of the `showPasswordless` feature flag. + * - Used by: Web, Browser + */ getShowPasswordlessFlag: () => boolean; - // Used on Browser and overriden on Desktop + /** + * Launches the SSO flow in a new browser window. + * - Used by: Browser, Desktop + */ launchSsoBrowserWindow: (email: string, clientId: "browser" | "desktop") => Promise; }