mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[PM-3198][PM-3199] Rename PasswordlessLoginStrategy (#6425)
* rename to LoginWithDeviceLoginStrategy * rename LoginWithDeviceComponent * update translation for web route * rename strategy to AuthRequestLoginStrategy * rename PasswordlessLogInCredentials and PasswordlessCreateAuthRequest * rename setPasswordlessAccessCode * rename startPasswordlessLogin() in template files * rename startPasswordlessLogin() for browser template file * rename AuthenticationType.Passwordless * standardize LogInStrategy to LoginStrategy * standardize PasswordLogInStrategy to PasswordLoginStrategy * standardize SsoLogInStrategy to SsoLoginStrategy * standardize UserApiLogInStrategy to UserApiLoginStrategy * standardize naming of login credentials * rename log-in-credentials.ts to login-credentials.ts
This commit is contained in:
@@ -16,10 +16,10 @@ import { TwoFactorProviderType } from "@bitwarden/common/auth/enums/two-factor-p
|
||||
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
|
||||
import { ForceResetPasswordReason } from "@bitwarden/common/auth/models/domain/force-reset-password-reason";
|
||||
import {
|
||||
PasswordLogInCredentials,
|
||||
SsoLogInCredentials,
|
||||
UserApiLogInCredentials,
|
||||
} from "@bitwarden/common/auth/models/domain/log-in-credentials";
|
||||
PasswordLoginCredentials,
|
||||
SsoLoginCredentials,
|
||||
UserApiLoginCredentials,
|
||||
} from "@bitwarden/common/auth/models/domain/login-credentials";
|
||||
import { TokenTwoFactorRequest } from "@bitwarden/common/auth/models/request/identity-token/token-two-factor.request";
|
||||
import { PasswordRequest } from "@bitwarden/common/auth/models/request/password.request";
|
||||
import { TwoFactorEmailRequest } from "@bitwarden/common/auth/models/request/two-factor-email.request";
|
||||
@@ -179,7 +179,7 @@ export class LoginCommand {
|
||||
}
|
||||
try {
|
||||
response = await this.authService.logIn(
|
||||
new UserApiLogInCredentials(clientId, clientSecret)
|
||||
new UserApiLoginCredentials(clientId, clientSecret)
|
||||
);
|
||||
} catch (e) {
|
||||
// handle API key login failures
|
||||
@@ -196,7 +196,7 @@ export class LoginCommand {
|
||||
}
|
||||
} else if (ssoCode != null && ssoCodeVerifier != null) {
|
||||
response = await this.authService.logIn(
|
||||
new SsoLogInCredentials(
|
||||
new SsoLoginCredentials(
|
||||
ssoCode,
|
||||
ssoCodeVerifier,
|
||||
this.ssoRedirectUri,
|
||||
@@ -206,7 +206,7 @@ export class LoginCommand {
|
||||
);
|
||||
} else {
|
||||
response = await this.authService.logIn(
|
||||
new PasswordLogInCredentials(email, password, null, twoFactor)
|
||||
new PasswordLoginCredentials(email, password, null, twoFactor)
|
||||
);
|
||||
}
|
||||
if (response.requiresEncryptionKeyMigration) {
|
||||
@@ -215,7 +215,7 @@ export class LoginCommand {
|
||||
);
|
||||
}
|
||||
if (response.captchaSiteKey) {
|
||||
const credentials = new PasswordLogInCredentials(email, password);
|
||||
const credentials = new PasswordLoginCredentials(email, password);
|
||||
const handledResponse = await this.handleCaptchaRequired(twoFactor, credentials);
|
||||
|
||||
// Error Response
|
||||
@@ -586,7 +586,7 @@ export class LoginCommand {
|
||||
|
||||
private async handleCaptchaRequired(
|
||||
twoFactorRequest: TokenTwoFactorRequest,
|
||||
credentials: PasswordLogInCredentials = null
|
||||
credentials: PasswordLoginCredentials = null
|
||||
): Promise<AuthResult | Response> {
|
||||
const badCaptcha = Response.badRequest(
|
||||
"Your authentication request has been flagged and will require user interaction to proceed.\n" +
|
||||
|
||||
Reference in New Issue
Block a user