1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 13:53:34 +00:00

PM-14445: Auth SSO Login TS strict failures (#13335)

This commit is contained in:
Maciej Zieniuk
2025-02-10 15:09:19 +01:00
committed by GitHub
parent 13a80ccff2
commit 1bd8a22c63
3 changed files with 9 additions and 9 deletions

View File

@@ -367,7 +367,7 @@ export class SsoComponent implements OnInit {
codeVerifier, codeVerifier,
redirectUri, redirectUri,
orgSsoIdentifier, orgSsoIdentifier,
email, email ?? undefined,
); );
this.formPromise = this.loginStrategyService.logIn(credentials); this.formPromise = this.loginStrategyService.logIn(credentials);
const authResult = await this.formPromise; const authResult = await this.formPromise;

View File

@@ -11,7 +11,7 @@ export abstract class SsoLoginServiceAbstraction {
* @see https://datatracker.ietf.org/doc/html/rfc7636 * @see https://datatracker.ietf.org/doc/html/rfc7636
* @returns The code verifier used for SSO. * @returns The code verifier used for SSO.
*/ */
abstract getCodeVerifier: () => Promise<string>; abstract getCodeVerifier: () => Promise<string | null>;
/** /**
* Sets the code verifier used for SSO. * Sets the code verifier used for SSO.
* *
@@ -31,7 +31,7 @@ export abstract class SsoLoginServiceAbstraction {
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1 * @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1
* @returns The SSO state. * @returns The SSO state.
*/ */
abstract getSsoState: () => Promise<string>; abstract getSsoState: () => Promise<string | null>;
/** /**
* Sets the value of the SSO state. * Sets the value of the SSO state.
* *
@@ -48,7 +48,7 @@ export abstract class SsoLoginServiceAbstraction {
* Do not use this value outside of the SSO login flow. * Do not use this value outside of the SSO login flow.
* @returns The user's organization identifier. * @returns The user's organization identifier.
*/ */
abstract getOrganizationSsoIdentifier: () => Promise<string>; abstract getOrganizationSsoIdentifier: () => Promise<string | null>;
/** /**
* Sets the value of the user's organization sso identifier. * Sets the value of the user's organization sso identifier.
* *
@@ -61,7 +61,7 @@ export abstract class SsoLoginServiceAbstraction {
* Note: This should only be used during the SSO flow to identify the user that is attempting to log in. * Note: This should only be used during the SSO flow to identify the user that is attempting to log in.
* @returns The user's email. * @returns The user's email.
*/ */
abstract getSsoEmail: () => Promise<string>; abstract getSsoEmail: () => Promise<string | null>;
/** /**
* Sets the user's email. * Sets the user's email.
* Note: This should only be used during the SSO flow to identify the user that is attempting to log in. * Note: This should only be used during the SSO flow to identify the user that is attempting to log in.

View File

@@ -73,7 +73,7 @@ export class SsoLoginService implements SsoLoginServiceAbstraction {
this.ssoEmailState = this.stateProvider.getGlobal(SSO_EMAIL); this.ssoEmailState = this.stateProvider.getGlobal(SSO_EMAIL);
} }
getCodeVerifier(): Promise<string> { getCodeVerifier(): Promise<string | null> {
return firstValueFrom(this.codeVerifierState.state$); return firstValueFrom(this.codeVerifierState.state$);
} }
@@ -81,7 +81,7 @@ export class SsoLoginService implements SsoLoginServiceAbstraction {
await this.codeVerifierState.update((_) => codeVerifier); await this.codeVerifierState.update((_) => codeVerifier);
} }
getSsoState(): Promise<string> { getSsoState(): Promise<string | null> {
return firstValueFrom(this.ssoState.state$); return firstValueFrom(this.ssoState.state$);
} }
@@ -89,7 +89,7 @@ export class SsoLoginService implements SsoLoginServiceAbstraction {
await this.ssoState.update((_) => ssoState); await this.ssoState.update((_) => ssoState);
} }
getOrganizationSsoIdentifier(): Promise<string> { getOrganizationSsoIdentifier(): Promise<string | null> {
return firstValueFrom(this.orgSsoIdentifierState.state$); return firstValueFrom(this.orgSsoIdentifierState.state$);
} }
@@ -97,7 +97,7 @@ export class SsoLoginService implements SsoLoginServiceAbstraction {
await this.orgSsoIdentifierState.update((_) => organizationIdentifier); await this.orgSsoIdentifierState.update((_) => organizationIdentifier);
} }
getSsoEmail(): Promise<string> { getSsoEmail(): Promise<string | null> {
return firstValueFrom(this.ssoEmailState.state$); return firstValueFrom(this.ssoEmailState.state$);
} }