send captcha bypass token on 2fa token request (#8511)
This commit is contained in:
parent
aaa745ec36
commit
d9bec7f984
|
@ -37,15 +37,11 @@ export class PasswordLoginStrategyData implements LoginStrategyData {
|
||||||
|
|
||||||
/** User's entered email obtained pre-login. Always present in MP login. */
|
/** User's entered email obtained pre-login. Always present in MP login. */
|
||||||
userEnteredEmail: string;
|
userEnteredEmail: string;
|
||||||
|
/** If 2fa is required, token is returned to bypass captcha */
|
||||||
captchaBypassToken?: string;
|
captchaBypassToken?: string;
|
||||||
/**
|
/** The local version of the user's master key hash */
|
||||||
* The local version of the user's master key hash
|
|
||||||
*/
|
|
||||||
localMasterKeyHash: string;
|
localMasterKeyHash: string;
|
||||||
/**
|
/** The user's master key */
|
||||||
* The user's master key
|
|
||||||
*/
|
|
||||||
masterKey: MasterKey;
|
masterKey: MasterKey;
|
||||||
/**
|
/**
|
||||||
* Tracks if the user needs to update their password due to
|
* Tracks if the user needs to update their password due to
|
||||||
|
@ -175,10 +171,10 @@ export class PasswordLoginStrategy extends LoginStrategy {
|
||||||
twoFactor: TokenTwoFactorRequest,
|
twoFactor: TokenTwoFactorRequest,
|
||||||
captchaResponse: string,
|
captchaResponse: string,
|
||||||
): Promise<AuthResult> {
|
): Promise<AuthResult> {
|
||||||
this.cache.next({
|
const data = this.cache.value;
|
||||||
...this.cache.value,
|
data.tokenRequest.captchaResponse = captchaResponse ?? data.captchaBypassToken;
|
||||||
captchaBypassToken: captchaResponse ?? this.cache.value.captchaBypassToken,
|
this.cache.next(data);
|
||||||
});
|
|
||||||
const result = await super.logInTwoFactor(twoFactor);
|
const result = await super.logInTwoFactor(twoFactor);
|
||||||
|
|
||||||
// 2FA was successful, save the force update password options with the state service if defined
|
// 2FA was successful, save the force update password options with the state service if defined
|
||||||
|
|
Loading…
Reference in New Issue