Other: Add launcher flag to ensure bridge starts

This commit is contained in:
James Houlahan
2022-10-12 15:22:02 +02:00
parent 89e07921f1
commit da33a6c48c
3 changed files with 32 additions and 7 deletions

View File

@ -356,8 +356,8 @@ func (s *Service) Login(ctx context.Context, login *LoginRequest) (*emptypb.Empt
go func() {
defer s.panicHandler.HandlePanic()
var password []byte
_, err := base64.StdEncoding.Decode(password, login.Password)
password, err := base64Decode(login.Password)
if err != nil {
s.log.WithError(err).Error("Cannot decode password")
_ = s.SendEvent(NewLoginError(LoginErrorType_USERNAME_PASSWORD_ERROR, "Cannot decode password"))
@ -593,3 +593,14 @@ func (s *Service) CurrentKeychain(ctx context.Context, _ *emptypb.Empty) (*wrapp
return wrapperspb.String(helper), nil
}
func base64Decode(in []byte) ([]byte, error) {
out := make([]byte, base64.StdEncoding.DecodedLen(len(in)))
n, err := base64.StdEncoding.Decode(out, in)
if err != nil {
return nil, err
}
return out[:n], nil
}