1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

Use apikey client secret as captcha validation (#454)

* Use apikey client secret as captcha validation

* Linter fixes
This commit is contained in:
Matt Gibson
2021-08-12 16:11:26 -04:00
committed by GitHub
parent 26e8b48deb
commit c5f236c2e4
3 changed files with 79 additions and 32 deletions

View File

@@ -20,7 +20,7 @@ export abstract class AuthService {
logInTwoFactor: (twoFactorProvider: TwoFactorProviderType, twoFactorToken: string,
remember?: boolean) => Promise<AuthResult>;
logInComplete: (email: string, masterPassword: string, twoFactorProvider: TwoFactorProviderType,
twoFactorToken: string, remember?: boolean) => Promise<AuthResult>;
twoFactorToken: string, remember?: boolean, captchaToken?: string) => Promise<AuthResult>;
logInSsoComplete: (code: string, codeVerifier: string, redirectUrl: string,
twoFactorProvider: TwoFactorProviderType, twoFactorToken: string, remember?: boolean) => Promise<AuthResult>;
logInApiKeyComplete: (clientId: string, clientSecret: string, twoFactorProvider: TwoFactorProviderType,

View File

@@ -151,14 +151,14 @@ export class AuthService implements AuthServiceAbstraction {
}
async logInComplete(email: string, masterPassword: string, twoFactorProvider: TwoFactorProviderType,
twoFactorToken: string, remember?: boolean): Promise<AuthResult> {
twoFactorToken: string, remember?: boolean, captchaToken?: string): Promise<AuthResult> {
this.selectedTwoFactorProviderType = null;
const key = await this.makePreloginKey(masterPassword, email);
const hashedPassword = await this.cryptoService.hashPassword(masterPassword, key);
const localHashedPassword = await this.cryptoService.hashPassword(masterPassword, key,
HashPurpose.LocalAuthorization);
return await this.logInHelper(email, hashedPassword, localHashedPassword, null, null, null, null, null, key,
twoFactorProvider, twoFactorToken, remember);
twoFactorProvider, twoFactorToken, remember, captchaToken);
}
async logInSsoComplete(code: string, codeVerifier: string, redirectUrl: string,