mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-04 00:08:33 +00:00
fix(BRIDGE-424): patch second password prompt
This commit is contained in:
@ -1277,6 +1277,10 @@ QtObject {
|
||||
function onLoginFidoError(errorMsg) {
|
||||
root.touchFidoKey.reset();
|
||||
}
|
||||
function onLogin2PasswordRequested(_) {
|
||||
root.touchFidoKey.reset();
|
||||
}
|
||||
|
||||
target: Backend
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,7 +133,8 @@ FocusScope {
|
||||
errorLabel.text = qsTr("Incorrect login credentials. Please try again.");
|
||||
}
|
||||
function onLogin2PasswordRequested(username) {
|
||||
console.assert(stackLayout.currentIndex === Login.RootStack.Login || stackLayout.currentIndex === Login.RootStack.TOTP, "Unexpected login2PasswordRequested");
|
||||
console.assert(stackLayout.currentIndex === Login.RootStack.Login || stackLayout.currentIndex === Login.RootStack.FIDO || stackLayout.currentIndex === Login.RootStack.TOTP, "Unexpected login2PasswordRequested");
|
||||
fidoLayout.reset();
|
||||
stackLayout.currentIndex = Login.RootStack.MailboxPassword;
|
||||
mailboxPasswordUsernameLabel.text = username;
|
||||
secondPasswordTextField.focus = true;
|
||||
|
||||
@ -25,6 +25,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ProtonMail/gluon/async"
|
||||
"github.com/ProtonMail/go-proton-api"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/fido"
|
||||
"github.com/keys-pub/go-libfido2"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
@ -104,6 +105,11 @@ func (s *Service) LoginFido(_ context.Context, login *LoginRequest) (*emptypb.Em
|
||||
return
|
||||
}
|
||||
|
||||
if s.auth.PasswordMode == proton.TwoPasswordMode {
|
||||
_ = s.SendEvent(NewLoginTwoPasswordsRequestedEvent(login.Username))
|
||||
return
|
||||
}
|
||||
|
||||
s.finishLogin()
|
||||
}()
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ package grpc
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/ProtonMail/go-proton-api"
|
||||
|
||||
"github.com/ProtonMail/gluon/async"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/fido"
|
||||
@ -46,6 +47,11 @@ func (s *Service) LoginFido(_ context.Context, login *LoginRequest) (*emptypb.Em
|
||||
return
|
||||
}
|
||||
|
||||
if s.auth.PasswordMode == proton.TwoPasswordMode {
|
||||
_ = s.SendEvent(NewLoginTwoPasswordsRequestedEvent(login.Username))
|
||||
return
|
||||
}
|
||||
|
||||
s.finishLogin()
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user