Add a method to allow checking if a token exists for a particular host
This commit is contained in:
parent
58592d4094
commit
faf1375db6
@ -156,6 +156,13 @@ void JsonRpcClient::acceptCertificate(const QString &serverUuid, const QByteArra
|
|||||||
storePem(serverUuid, pem);
|
storePem(serverUuid, pem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool JsonRpcClient::tokenExists(const QString &serverUuid) const
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
settings.beginGroup("jsonTokens");
|
||||||
|
return settings.contains(QUuid(serverUuid).toString());
|
||||||
|
}
|
||||||
|
|
||||||
void JsonRpcClient::getCloudConnectionStatus()
|
void JsonRpcClient::getCloudConnectionStatus()
|
||||||
{
|
{
|
||||||
JsonRpcReply *reply = createReply("JSONRPC.IsCloudConnected", QVariantMap(), this, "isCloudConnectedReply");
|
JsonRpcReply *reply = createReply("JSONRPC.IsCloudConnected", QVariantMap(), this, "isCloudConnectedReply");
|
||||||
|
|||||||
@ -106,6 +106,7 @@ public:
|
|||||||
Q_INVOKABLE void connectToHost(NymeaHost *host, Connection *connection = nullptr);
|
Q_INVOKABLE void connectToHost(NymeaHost *host, Connection *connection = nullptr);
|
||||||
Q_INVOKABLE void disconnectFromHost();
|
Q_INVOKABLE void disconnectFromHost();
|
||||||
Q_INVOKABLE void acceptCertificate(const QString &serverUuid, const QByteArray &pem);
|
Q_INVOKABLE void acceptCertificate(const QString &serverUuid, const QByteArray &pem);
|
||||||
|
Q_INVOKABLE bool tokenExists(const QString &serverUuid) const;
|
||||||
|
|
||||||
Q_INVOKABLE bool ensureServerVersion(const QString &jsonRpcVersion);
|
Q_INVOKABLE bool ensureServerVersion(const QString &jsonRpcVersion);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user