If no authToken is stored in settings but email and password are on startup the log_in route is triggered to receive a new token. This token will be used to access a protected API.
This commit is contained in:
@ -22,10 +22,15 @@ class ServerCommunicator : public QObject {
|
||||
QUrl url() const;
|
||||
void setUrl(const QUrl& url);
|
||||
|
||||
void setServerConfiguration(const QString url, const QString email, const QString password);
|
||||
void setServerConfiguration(const QString url,
|
||||
const QString email,
|
||||
const QString password,
|
||||
const QString authToken);
|
||||
QString getUserLoginUrl() const;
|
||||
|
||||
public slots:
|
||||
void onLoginTriggered();
|
||||
|
||||
void onSendGetRequestTriggered(const GetRequestTypes type, QVariant data);
|
||||
void onGetReplySuccessful(const GetRequestTypes type, const QJsonDocument doc);
|
||||
void onGetReplyFailure(const GetRequestTypes type, const QString errorString);
|
||||
@ -44,6 +49,8 @@ class ServerCommunicator : public QObject {
|
||||
void deleteRequestSuccessful(const QByteArray responseData);
|
||||
void deleteRequestFailure(const QString errorString);
|
||||
|
||||
void loginSuccessful();
|
||||
|
||||
void currentBiddingRoundChanged(int round, bool isRunning);
|
||||
void biddingsChanged(QList<bidding> biddings);
|
||||
void onlineUserAccountReceived(const QString mailAddress,
|
||||
@ -59,9 +66,13 @@ class ServerCommunicator : public QObject {
|
||||
|
||||
QString m_email;
|
||||
QString m_password;
|
||||
// QString m_authToken;
|
||||
QString m_authToken;
|
||||
|
||||
QByteArray createLoginBody();
|
||||
|
||||
/// reply parser
|
||||
void handleLogInReply(const QJsonDocument jsonDoc);
|
||||
|
||||
void currentBiddingRoundChangedReply(const QJsonDocument jsonDoc);
|
||||
void currentBiddingsReply(const QJsonDocument jsonDoc);
|
||||
void onlineUserAccountReply(const QJsonDocument jsonDoc);
|
||||
|
||||
Reference in New Issue
Block a user