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));
|
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(newTk));
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsonApiPage::removeTokenClicked()
|
void JsonApiPage::removeTokenClicked()
|
||||||
{
|
{
|
||||||
QString token(ui.tokenLineEdit->text());
|
QString token(ui.tokenLineEdit->text());
|
||||||
rsJsonApi->revokeAuthToken(token.toStdString());
|
std::string tokenStr = token.toStdString();
|
||||||
|
rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":")));
|
||||||
QStringList newTk;
|
|
||||||
|
QStringList newTk;
|
||||||
for(const auto& it : rsJsonApi->getAuthorizedTokens())
|
|
||||||
newTk.push_back(
|
for(const auto& it : rsJsonApi->getAuthorizedTokens())
|
||||||
QString::fromStdString(it.first) + ":" +
|
newTk.push_back(
|
||||||
QString::fromStdString(it.second) );
|
QString::fromStdString(it.first) + ":" +
|
||||||
|
QString::fromStdString(it.second) );
|
||||||
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) );
|
|
||||||
}
|
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) );
|
||||||
|
}
|
||||||
|
|
||||||
void JsonApiPage::tokenClicked(const QModelIndex& index)
|
void JsonApiPage::tokenClicked(const QModelIndex& index)
|
||||||
{
|
{
|
||||||
ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString());
|
ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user