| 93 | } |
| 94 | |
| 95 | void Dialog::authorizeClicked() |
| 96 | { |
| 97 | QPointer<KPasswordDialog> dlg = new KPasswordDialog(this, KPasswordDialog::ShowUsernameLine); |
| 98 | dlg->setPrompt(i18n("Enter a login and a password")); |
| 99 | if(dlg->exec()) { |
| 100 | m_text->setAlignment(Qt::AlignCenter); |
| 101 | m_text->setText(i18n("Waiting for response")); |
| 102 | m_account->setName(dlg->username()); |
| 103 | |
| 104 | Resource *rs = m_account->resource(); |
| 105 | rs->authenticate(dlg->username(), dlg->password()); |
| 106 | connect(rs, &Resource::twoFactorAuthRequested, |
| 107 | this, &Dialog::twoFactorResponse); |
| 108 | connect(rs, &Resource::authenticated, |
| 109 | this, &Dialog::authorizeResponse); |
| 110 | } |
| 111 | delete dlg; |
| 112 | } |
| 113 | |
| 114 | void Dialog::authorizeResponse(const QByteArray &id, const QByteArray &token, const QString &tokenName) |
| 115 | { |
nothing calls this directly
no test coverage detected