mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-03-03 12:19:31 -05:00
Fix JSON API token removal
This commit is contained in:
parent
2ca36f5957
commit
0759359e06
@ -232,23 +232,23 @@ void JsonApiPage::addTokenClicked()
|
||||
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(newTk));
|
||||
}
|
||||
|
||||
void JsonApiPage::removeTokenClicked()
|
||||
{
|
||||
QString token(ui.tokenLineEdit->text());
|
||||
rsJsonApi->revokeAuthToken(token.toStdString());
|
||||
|
||||
QStringList newTk;
|
||||
|
||||
for(const auto& it : rsJsonApi->getAuthorizedTokens())
|
||||
newTk.push_back(
|
||||
QString::fromStdString(it.first) + ":" +
|
||||
QString::fromStdString(it.second) );
|
||||
|
||||
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) );
|
||||
}
|
||||
|
||||
void JsonApiPage::removeTokenClicked()
|
||||
{
|
||||
QString token(ui.tokenLineEdit->text());
|
||||
std::string tokenStr = token.toStdString();
|
||||
rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":")));
|
||||
|
||||
QStringList newTk;
|
||||
|
||||
for(const auto& it : rsJsonApi->getAuthorizedTokens())
|
||||
newTk.push_back(
|
||||
QString::fromStdString(it.first) + ":" +
|
||||
QString::fromStdString(it.second) );
|
||||
|
||||
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) );
|
||||
}
|
||||
|
||||
void JsonApiPage::tokenClicked(const QModelIndex& index)
|
||||
{
|
||||
ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user