Can store login tokens.

This commit is contained in:
Pierre HUBERT
2018-11-29 15:53:54 +01:00
parent 99724f845c
commit 1a3169bc16
13 changed files with 269 additions and 6 deletions

View File

@ -17,6 +17,7 @@ enum LoginResult {
INVALID_CREDENTIALS,
TOO_MANY_REQUEST,
NETWORK_ERROR,
INVALID_SERVER_RESPONSE,
OTHER_ERROR
};

View File

@ -0,0 +1,31 @@
#include "accountlogintokens.h"
AccountLoginTokens::AccountLoginTokens()
{
}
bool AccountLoginTokens::isValid()
{
return token1().length() > 0 && token2().length() > 0;
}
QString AccountLoginTokens::token1() const
{
return mToken1;
}
void AccountLoginTokens::setToken1(const QString &token1)
{
mToken1 = token1;
}
QString AccountLoginTokens::token2() const
{
return mToken2;
}
void AccountLoginTokens::setToken2(const QString &token2)
{
mToken2 = token2;
}

36
data/accountlogintokens.h Normal file
View File

@ -0,0 +1,36 @@
/**
* Account Login tokens
*
* @author Pierre HUBERT
*/
#ifndef ACCOUNTLOGINTOKENS_H
#define ACCOUNTLOGINTOKENS_H
#include <QString>
class AccountLoginTokens
{
public:
AccountLoginTokens();
/**
* Check if the tokens present in this object
* are valid or not
*
* @return TRUE if the tokens are valid / FALSE else
*/
bool isValid();
QString token1() const;
void setToken1(const QString &token1);
QString token2() const;
void setToken2(const QString &token2);
private:
QString mToken1;
QString mToken2;
};
#endif // ACCOUNTLOGINTOKENS_H