| 112 | } |
| 113 | |
| 114 | void Dialog::authorizeResponse(const QByteArray &id, const QByteArray &token, const QString &tokenName) |
| 115 | { |
| 116 | Q_UNUSED(tokenName); |
| 117 | |
| 118 | Resource *rs = m_account->resource(); |
| 119 | disconnect(rs, &Resource::authenticated, |
| 120 | this, &Dialog::authorizeResponse); |
| 121 | |
| 122 | if (id.isEmpty()) { |
| 123 | m_text->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); |
| 124 | m_text->setText(invalidAccountText()); |
| 125 | m_account->setName(QString()); |
| 126 | KMessageBox::error(this, i18n("Authentication failed. Please try again.\n\n" |
| 127 | "Could not create token: \"%1\"\n%2", tokenName, |
| 128 | tokenLinkStatementText()), |
| 129 | i18nc("@title:window", "GitHub Authorization Failed")); |
| 130 | return; |
| 131 | } |
| 132 | else{ |
| 133 | KMessageBox::information(this, i18n("Authentication succeeded.\n\n" |
| 134 | "Created token: \"%1\"\n%2", tokenName, |
| 135 | tokenLinkStatementText()), |
| 136 | i18nc("@title:window", "GitHub Account Authorized")); |
| 137 | } |
| 138 | m_account->saveToken(id, token); |
| 139 | syncUser(); |
| 140 | } |
| 141 | |
| 142 | void Dialog::twoFactorResponse(const QString &transferHeader) |
| 143 | { |
nothing calls this directly
no test coverage detected