Added initial api support to delete passkey.
This commit is contained in:
@@ -66,6 +66,22 @@ void Passkeys::registerPasskey(
|
||||
}).send();
|
||||
}
|
||||
|
||||
void Passkeys::deletePasskey(
|
||||
const QString &id,
|
||||
Fn<void()> done,
|
||||
Fn<void(QString)> fail) {
|
||||
_session->api().request(MTPaccount_DeletePasskey(
|
||||
MTP_string(id)
|
||||
)).done([=] {
|
||||
_lastRequestTime = 0;
|
||||
_listKnown = false;
|
||||
loadList();
|
||||
done();
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
fail(error.type());
|
||||
}).send();
|
||||
}
|
||||
|
||||
rpl::producer<> Passkeys::requestList() {
|
||||
if (crl::now() - _lastRequestTime > kTimeoutMs) {
|
||||
if (!_listRequestId) {
|
||||
|
||||
@@ -37,6 +37,10 @@ public:
|
||||
void registerPasskey(
|
||||
const Platform::WebAuthn::RegisterResult &result,
|
||||
Fn<void()> done);
|
||||
void deletePasskey(
|
||||
const QString &id,
|
||||
Fn<void()> done,
|
||||
Fn<void(QString)> fail);
|
||||
[[nodiscard]] rpl::producer<> requestList();
|
||||
[[nodiscard]] const std::vector<PasskeyEntry> &list() const;
|
||||
[[nodiscard]] bool listKnown() const;
|
||||
|
||||
Reference in New Issue
Block a user